diff --git a/Barotrauma/BarotraumaShared/Source/Networking/RespawnManager.cs b/Barotrauma/BarotraumaShared/Source/Networking/RespawnManager.cs index f32d873ce..d32650e6d 100644 --- a/Barotrauma/BarotraumaShared/Source/Networking/RespawnManager.cs +++ b/Barotrauma/BarotraumaShared/Source/Networking/RespawnManager.cs @@ -277,15 +277,15 @@ namespace Barotrauma.Networking if (door.IsOpen) door.SetState(false,false,true); } + var server = networkMember as GameServer; + if (server == null) return; + var shuttleGaps = Gap.GapList.FindAll(g => g.Submarine == respawnShuttle && g.ConnectedWall != null); - shuttleGaps.ForEach(g => g.Remove()); + shuttleGaps.ForEach(g => Spawner.AddToRemoveQueue(g)); var dockingPorts = Item.ItemList.FindAll(i => i.Submarine == respawnShuttle && i.GetComponent() != null); dockingPorts.ForEach(d => d.GetComponent().Undock()); - var server = networkMember as GameServer; - if (server == null) return; - //shuttle has returned if the path has been traversed or the shuttle is close enough to the exit if (!CoroutineManager.IsCoroutineRunning("forcepos")) @@ -405,7 +405,7 @@ namespace Barotrauma.Networking } var shuttleGaps = Gap.GapList.FindAll(g => g.Submarine == respawnShuttle && g.ConnectedWall != null); - shuttleGaps.ForEach(g => g.Remove()); + shuttleGaps.ForEach(g => Spawner.AddToRemoveQueue(g)); foreach (Hull hull in Hull.hullList) { @@ -427,7 +427,7 @@ namespace Barotrauma.Networking foreach (Item item in c.Inventory.Items) { if (item == null) continue; - Entity.Spawner.AddToRemoveQueue(item); + Spawner.AddToRemoveQueue(item); } }