Fixed some entities occasionally not being removed at the end of a round. CargoMission removed the cargo items at the end of a round without checking if the items have already been removed, which could cause another entity to be removed from the entity dictionary if it's taken the ID of the cargo item. This prevented the new entity from being removed in Entity.RemoveAll, causing errors during the next round. Closes #278

This commit is contained in:
Joonas Rikkonen
2018-04-23 13:55:08 +03:00
parent e61dc5ae5f
commit ceaba2f5ca
6 changed files with 35 additions and 5 deletions
@@ -196,7 +196,7 @@ namespace Barotrauma
else if (entities.Entity is Character)
{
message.Write((byte)SpawnableType.Character);
DebugConsole.NewMessage("WRITING CHARACTER DATA: " + (entities.Entity).ToString(),Color.Cyan);
DebugConsole.NewMessage("WRITING CHARACTER DATA: " + (entities.Entity).ToString() + " (ID: " + entities.Entity.ID + ")", Color.Cyan);
((Character)entities.Entity).WriteSpawnData(message);
}
}