2f107db...5202af9
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user