Fixed oxygen tank & welding fuel tank crafting causing everyone to desync. The item condition NetEntityEvent was created before the spawn event of the item, preventing clients from reading the condition event because the item doesn't exist yet. Closes #617
This commit is contained in:
@@ -49,7 +49,6 @@ namespace Barotrauma
|
||||
public Entity Spawn()
|
||||
{
|
||||
Item spawnedItem = null;
|
||||
|
||||
if (Inventory != null)
|
||||
{
|
||||
spawnedItem = new Item(Prefab, Vector2.Zero, null);
|
||||
@@ -59,8 +58,6 @@ namespace Barotrauma
|
||||
{
|
||||
spawnedItem = new Item(Prefab, Position, Submarine);
|
||||
}
|
||||
spawnedItem.Condition = Condition;
|
||||
|
||||
return spawnedItem;
|
||||
}
|
||||
}
|
||||
@@ -159,6 +156,10 @@ namespace Barotrauma
|
||||
if (spawnedEntity != null)
|
||||
{
|
||||
CreateNetworkEvent(spawnedEntity, false);
|
||||
if (spawnedEntity is Item)
|
||||
{
|
||||
((Item)spawnedEntity).Condition = ((ItemSpawnInfo)entitySpawnInfo).Condition;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user