Inventory syncing fix: the inventory of the character that's being controlled would not be updated when the character can't access it (e.g. because of wearing handcuffs or being unconscious), preventing inventory updates from being applied.

This commit is contained in:
Joonas Rikkonen
2018-11-24 18:50:55 +02:00
parent db2ced7c3d
commit 0463e2d9cf

View File

@@ -169,8 +169,6 @@ namespace Barotrauma
public virtual void Update(float deltaTime, bool subInventory = false)
{
syncItemsDelay = Math.Max(syncItemsDelay - deltaTime, 0.0f);
if (slots == null || isSubInventory != subInventory)
{
CreateSlots();
@@ -500,6 +498,7 @@ namespace Barotrauma
{
while (syncItemsDelay > 0.0f || (GameMain.Client != null && GameMain.Client.MidRoundSyncing))
{
syncItemsDelay = Math.Max((float)(syncItemsDelay - Timing.Step), 0.0f);
yield return CoroutineStatus.Running;
}