- EntitySpawner recursively deletes contained items when an item is deleted
- items in the inventories of the characters inside the shuttle are deleted when resetting the respawn shuttle - fixed host's character not being taken into account when assigning jobs for respawning characters if the host is not respawning
This commit is contained in:
@@ -324,7 +324,8 @@ namespace Barotrauma.Networking
|
||||
|
||||
if (item.body != null && item.body.Enabled && item.ParentInventory == null)
|
||||
{
|
||||
Item.Spawner.AddToRemoveQueue(item);
|
||||
Entity.Spawner.AddToRemoveQueue(item);
|
||||
continue;
|
||||
}
|
||||
|
||||
item.Condition = 100.0f;
|
||||
@@ -362,9 +363,17 @@ namespace Barotrauma.Networking
|
||||
if (c.Submarine == respawnShuttle)
|
||||
{
|
||||
if (Character.Controlled == c) Character.Controlled = null;
|
||||
//if (networkMember.Character == c) networkMember.Character = null;
|
||||
c.Enabled = false;
|
||||
|
||||
if (c.Inventory != null)
|
||||
{
|
||||
foreach (Item item in c.Inventory.Items)
|
||||
{
|
||||
if (item == null) continue;
|
||||
Entity.Spawner.AddToRemoveQueue(item);
|
||||
}
|
||||
}
|
||||
|
||||
c.Kill(CauseOfDeath.Damage, true);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user