Skip to content

Commit

Permalink
Predict StorageComponent in PseudoItem
Browse files Browse the repository at this point in the history
  • Loading branch information
DebugOk committed Sep 27, 2023
1 parent dd6799f commit f73dd59
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using Content.Shared.DoAfter;
using Content.Shared.IdentityManagement;
using Content.Shared.Item.PseudoItem;
using Content.Shared.Storage.Components;
using Content.Server.Storage.Components;
using Content.Server.Storage.EntitySystems;
using Content.Server.DoAfter;
Expand Down Expand Up @@ -35,7 +36,7 @@ private void AddInsertVerb(EntityUid uid, PseudoItemComponent component, GetVerb
if (component.Active)
return;

if (!TryComp<ServerStorageComponent>(args.Target, out var targetStorage))
if (!TryComp<StorageComponent>(args.Target, out var targetStorage))
return;

if (component.Size > targetStorage.StorageCapacityMax - targetStorage.StorageUsed)
Expand Down Expand Up @@ -67,7 +68,7 @@ private void AddInsertAltVerb(EntityUid uid, PseudoItemComponent component, GetV
if (args.Hands == null)
return;

if (!TryComp<ServerStorageComponent>(args.Hands.ActiveHandEntity, out var targetStorage))
if (!TryComp<StorageComponent>(args.Hands.ActiveHandEntity, out var targetStorage))
return;

AlternativeVerb verb = new()
Expand Down Expand Up @@ -113,7 +114,7 @@ private void OnDoAfter(EntityUid uid, PseudoItemComponent component, DoAfterEven
args.Handled = TryInsert(args.Args.Used.Value, uid, component);
}

public bool TryInsert(EntityUid storageUid, EntityUid toInsert, PseudoItemComponent component, ServerStorageComponent? storage = null)
public bool TryInsert(EntityUid storageUid, EntityUid toInsert, PseudoItemComponent component, StorageComponent? storage = null)
{
if (!Resolve(storageUid, ref storage))
return false;
Expand Down

0 comments on commit f73dd59

Please sign in to comment.