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(); } }
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(); } } }