2f107db...5202af9

This commit is contained in:
Joonas Rikkonen
2019-03-18 21:42:26 +02:00
parent 58c92888b7
commit 044fd3344b
395 changed files with 27417 additions and 19754 deletions
@@ -89,26 +89,20 @@ namespace Barotrauma
return wasPut;
}
protected override void CreateNetworkEvent()
public override void CreateNetworkEvent()
{
int componentIndex = container.Item.components.IndexOf(container);
int componentIndex = container.Item.GetComponentIndex(container);
if (componentIndex == -1)
{
DebugConsole.Log("Creating a network event for the item \"" + container.Item + "\" failed, ItemContainer not found in components");
return;
}
if (GameMain.Server != null)
if (GameMain.NetworkMember != null)
{
GameMain.Server.CreateEntityEvent(Owner as IServerSerializable, new object[] { NetEntityEvent.Type.InventoryState, componentIndex });
if (GameMain.NetworkMember.IsClient) { syncItemsDelay = 1.0f; }
GameMain.NetworkMember.CreateEntityEvent(Owner as INetSerializable, new object[] { NetEntityEvent.Type.InventoryState, componentIndex });
}
#if CLIENT
else if (GameMain.Client != null)
{
syncItemsDelay = 1.0f;
GameMain.Client.CreateEntityEvent(Owner as IClientSerializable, new object[] { NetEntityEvent.Type.InventoryState, componentIndex });
}
#endif
}
public override void RemoveItem(Item item)