Пример #1
0
        void processStructureDeath(NetIncomingMessage msg)
        {
            short structureID = msg.ReadInt16();
            short team        = msg.ReadInt16();

            Structure structure = Player.Players[team].StructureArray[structureID];

            if (structure != null && !structure.IsDead)
            {
                structure.Die();
            }
        }
Пример #2
0
        void processStructureStatusUpdate(NetIncomingMessage msg)
        {
            short structureID = msg.ReadInt16();
            short team        = msg.ReadInt16();
            short hp          = msg.ReadInt16();

            Structure structure = Player.Players[team].StructureArray[structureID];

            if (structure != null && hp < structure.Hp && structure.HasTakenDamageEver)
            {
                structure.Hp = hp;
                if (hp <= 0)
                {
                    structure.Die();
                }
            }
        }