diff --git a/logic/Gaming/Game.cs b/logic/Gaming/Game.cs index 1e1fa013..f51be1ca 100755 --- a/logic/Gaming/Game.cs +++ b/logic/Gaming/Game.cs @@ -131,7 +131,7 @@ public bool MoveShip(long teamID, long shipID, int moveTimeInMilliseconds, doubl if (!gameMap.Timer.IsGaming) return false; Ship? ship = gameMap.FindShipInPlayerID(teamID, shipID); - if (ship != null) + if (ship != null && ship.IsRemoved == false) { return actionManager.MoveShip(ship, moveTimeInMilliseconds, angle); } @@ -145,7 +145,7 @@ public bool Produce(long teamID, long shipID) if (!gameMap.Timer.IsGaming) return false; Ship? ship = gameMap.FindShipInPlayerID(teamID, shipID); - if (ship != null) + if (ship != null && ship.IsRemoved == false) return actionManager.Produce(ship); return false; } @@ -154,7 +154,7 @@ public bool Construct(long teamID, long shipID, ConstructionType constructionTyp if (!gameMap.Timer.IsGaming) return false; Ship? ship = gameMap.FindShipInPlayerID(teamID, shipID); - if (ship != null) + if (ship != null && ship.IsRemoved == false) { return actionManager.Construct(ship, constructionType); } @@ -165,7 +165,7 @@ public bool InstallModule(long teamID, long shipID, ModuleType moduleType) if (!gameMap.Timer.IsGaming) return false; Ship? ship = gameMap.FindShipInPlayerID(teamID, shipID); - if (ship != null) + if (ship != null && ship.IsRemoved == false) return moduleManager.InstallModule(ship, moduleType); return false; } @@ -174,7 +174,7 @@ public bool Recover(long teamID, long shipID, long recover) if (!gameMap.Timer.IsGaming) return false; Ship? ship = gameMap.FindShipInPlayerID(teamID, shipID); - if (ship != null) + if (ship != null && ship.IsRemoved == false) { bool validRecoverPoint = false; foreach (XY recoverPoint in teamList[(int)ship.TeamID].BirthPointList) @@ -197,7 +197,7 @@ public bool Recycle(long teamID, long shipID) if (!gameMap.Timer.IsGaming) return false; Ship? ship = gameMap.FindShipInPlayerID(teamID, shipID); - if (ship != null) + if (ship != null && ship.IsRemoved == false) { bool validRecyclePoint = false; foreach (XY recyclePoint in teamList[(int)ship.TeamID].BirthPointList) @@ -238,7 +238,7 @@ public bool Attack(long teamID, long shipID, double angle) if (!gameMap.Timer.IsGaming) return false; Ship? ship = gameMap.FindShipInPlayerID(teamID, shipID); - if (ship != null) + if (ship != null && ship.IsRemoved == false) return attackManager.Attack(ship, angle); return false; } diff --git a/logic/Server/CopyInfo.cs b/logic/Server/CopyInfo.cs index 72aad963..d15d4acd 100755 --- a/logic/Server/CopyInfo.cs +++ b/logic/Server/CopyInfo.cs @@ -11,6 +11,8 @@ public static class CopyInfo { public static MessageOfObj? Auto(GameObj gameObj, long time) { + if (gameObj.IsRemoved == true) + return null; switch (gameObj.Type) { case GameObjType.Ship: