Fixed clients getting desynced if cargomanager spawns extra containers due to running out of space.
This commit is contained in:
@@ -152,11 +152,17 @@ namespace Barotrauma
|
|||||||
}
|
}
|
||||||
for (int i = 0; i < Pi.quantity; i++)
|
for (int i = 0; i < Pi.quantity; i++)
|
||||||
{
|
{
|
||||||
|
//if the intial container has been removed due to it running out of space, add a new container
|
||||||
|
//of the same type and begin filling it
|
||||||
if (!availableContainers.ContainsKey(itemContainer))
|
if (!availableContainers.ContainsKey(itemContainer))
|
||||||
{
|
{
|
||||||
Item containerItemOverFlow = new Item(containerPrefab, position, wp.Submarine);
|
Item containerItemOverFlow = new Item(containerPrefab, position, wp.Submarine);
|
||||||
itemContainer = containerItemOverFlow.GetComponent<ItemContainer>();
|
itemContainer = containerItemOverFlow.GetComponent<ItemContainer>();
|
||||||
availableContainers.Add(itemContainer, itemContainer.Capacity);
|
availableContainers.Add(itemContainer, itemContainer.Capacity);
|
||||||
|
if (GameMain.Server != null)
|
||||||
|
{
|
||||||
|
Entity.Spawner.CreateNetworkEvent(itemContainer.Item, false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (itemContainer == null)
|
if (itemContainer == null)
|
||||||
|
|||||||
Reference in New Issue
Block a user