Predict StorageComponent (#19682)

This commit is contained in:
metalgearsloth
2023-09-11 21:20:46 +10:00
committed by GitHub
parent 99b77bc2d3
commit d5bd1c6f86
68 changed files with 1124 additions and 1121 deletions

View File

@@ -1,7 +1,7 @@
using Content.Server.Storage.Components;
using Content.Server.Storage.EntitySystems;
using Content.Server.Storage.EntitySystems;
using Content.Shared.Item;
using Content.Shared.Stacks;
using Content.Shared.Storage;
namespace Content.Server.Item;
@@ -14,9 +14,12 @@ public sealed class ItemSystem : SharedItemSystem
base.OnStackCountChanged(uid, component, args);
if (!Container.TryGetContainingContainer(uid, out var container) ||
!TryComp<ServerStorageComponent>(container.Owner, out var storage))
!TryComp<StorageComponent>(container.Owner, out var storage))
{
return;
}
_storage.RecalculateStorageUsed(storage);
_storage.UpdateStorageUI(container.Owner, storage);
_storage.UpdateUI(container.Owner, storage);
}
}