Fix ambiguous Dumpable behaviour (#13736)

This commit is contained in:
Joel Hedtjärn
2023-01-27 17:25:07 +01:00
committed by GitHub
parent 21db92547f
commit 589854449b
2 changed files with 3 additions and 2 deletions

View File

@@ -21,7 +21,7 @@ namespace Content.Server.Storage.EntitySystems
public override void Initialize() public override void Initialize()
{ {
base.Initialize(); base.Initialize();
SubscribeLocalEvent<DumpableComponent, AfterInteractEvent>(OnAfterInteract); SubscribeLocalEvent<DumpableComponent, AfterInteractEvent>(OnAfterInteract, after: new[]{ typeof(StorageSystem) });
SubscribeLocalEvent<DumpableComponent, GetVerbsEvent<AlternativeVerb>>(AddDumpVerb); SubscribeLocalEvent<DumpableComponent, GetVerbsEvent<AlternativeVerb>>(AddDumpVerb);
SubscribeLocalEvent<DumpableComponent, GetVerbsEvent<UtilityVerb>>(AddUtilityVerbs); SubscribeLocalEvent<DumpableComponent, GetVerbsEvent<UtilityVerb>>(AddUtilityVerbs);
SubscribeLocalEvent<DumpCompletedEvent>(OnDumpCompleted); SubscribeLocalEvent<DumpCompletedEvent>(OnDumpCompleted);
@@ -36,7 +36,7 @@ namespace Content.Server.Storage.EntitySystems
if (!TryComp<ServerStorageComponent>(args.Used, out var storage)) if (!TryComp<ServerStorageComponent>(args.Used, out var storage))
return; return;
if (storage.StoredEntities == null || storage.StoredEntities.Count == 0) if (storage.StoredEntities == null || storage.StoredEntities.Count == 0 || storage.CancelToken != null)
return; return;
if (HasComp<DisposalUnitComponent>(args.Target) || HasComp<PlaceableSurfaceComponent>(args.Target)) if (HasComp<DisposalUnitComponent>(args.Target) || HasComp<PlaceableSurfaceComponent>(args.Target))

View File

@@ -316,6 +316,7 @@ namespace Content.Server.Storage.EntitySystems
{ {
if (entity == args.User if (entity == args.User
|| !itemQuery.HasComponent(entity) || !itemQuery.HasComponent(entity)
|| !CanInsert(uid, entity, out _, storageComp)
|| !_interactionSystem.InRangeUnobstructed(args.User, entity)) || !_interactionSystem.InRangeUnobstructed(args.User, entity))
continue; continue;