Fixed only the first inventory of an item being synced (e.g. clients wouldn't get notified when an item is contained in the "output inventory" of a fabricator or deconstructor).
This commit is contained in:
@@ -377,7 +377,8 @@ namespace Barotrauma
|
||||
(components[componentIndex] as IServerSerializable).ClientRead(type, msg, sendingTime);
|
||||
break;
|
||||
case NetEntityEvent.Type.InventoryState:
|
||||
ownInventory.ClientRead(type, msg, sendingTime);
|
||||
int containerIndex = msg.ReadRangedInteger(0, components.Count - 1);
|
||||
(components[containerIndex] as ItemContainer).Inventory.ClientRead(type, msg, sendingTime);
|
||||
break;
|
||||
case NetEntityEvent.Type.Status:
|
||||
condition = msg.ReadRangedSingle(0.0f, prefab.Health, 8);
|
||||
@@ -425,11 +426,12 @@ namespace Barotrauma
|
||||
case NetEntityEvent.Type.ComponentState:
|
||||
int componentIndex = (int)extraData[1];
|
||||
msg.WriteRangedInteger(0, components.Count - 1, componentIndex);
|
||||
|
||||
(components[componentIndex] as IClientSerializable).ClientWrite(msg, extraData);
|
||||
break;
|
||||
case NetEntityEvent.Type.InventoryState:
|
||||
ownInventory.ClientWrite(msg, extraData);
|
||||
int containerIndex = (int)extraData[1];
|
||||
msg.WriteRangedInteger(0, components.Count - 1, containerIndex);
|
||||
(components[containerIndex] as ItemContainer).Inventory.ClientWrite(msg, extraData);
|
||||
break;
|
||||
case NetEntityEvent.Type.Repair:
|
||||
if (FixRequirements.Count > 0)
|
||||
|
||||
Reference in New Issue
Block a user