From 908e47664369b7e99f30b6c4c333004500d53d48 Mon Sep 17 00:00:00 2001 From: slarticodefast <161409025+slarticodefast@users.noreply.github.com> Date: Wed, 18 Dec 2024 01:12:35 +0100 Subject: [PATCH] Fix admins not being able to health scan slimes (#33884) --- .../Storage/EntitySystems/SharedStorageSystem.cs | 4 ++-- Content.Shared/Storage/StorageComponent.cs | 12 +++++++++++- Resources/Prototypes/Entities/Mobs/Species/slime.yml | 1 + 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/Content.Shared/Storage/EntitySystems/SharedStorageSystem.cs b/Content.Shared/Storage/EntitySystems/SharedStorageSystem.cs index 183420db9d..123282fbdb 100644 --- a/Content.Shared/Storage/EntitySystems/SharedStorageSystem.cs +++ b/Content.Shared/Storage/EntitySystems/SharedStorageSystem.cs @@ -360,7 +360,7 @@ public abstract class SharedStorageSystem : EntitySystem /// true if inserted, false otherwise private void OnInteractUsing(EntityUid uid, StorageComponent storageComp, InteractUsingEvent args) { - if (args.Handled || !CanInteract(args.User, (uid, storageComp), storageComp.ClickInsert, false)) + if (args.Handled || !storageComp.ClickInsert || !CanInteract(args.User, (uid, storageComp), silent: false)) return; var attemptEv = new StorageInteractUsingAttemptEvent(); @@ -380,7 +380,7 @@ public abstract class SharedStorageSystem : EntitySystem /// private void OnActivate(EntityUid uid, StorageComponent storageComp, ActivateInWorldEvent args) { - if (args.Handled || !args.Complex || !CanInteract(args.User, (uid, storageComp), storageComp.ClickInsert)) + if (args.Handled || !args.Complex || !storageComp.OpenOnActivate || !CanInteract(args.User, (uid, storageComp))) return; // Toggle diff --git a/Content.Shared/Storage/StorageComponent.cs b/Content.Shared/Storage/StorageComponent.cs index 5683ae95a7..52547454a0 100644 --- a/Content.Shared/Storage/StorageComponent.cs +++ b/Content.Shared/Storage/StorageComponent.cs @@ -65,8 +65,18 @@ namespace Content.Shared.Storage [DataField] public TimeSpan OpenUiCooldown = TimeSpan.Zero; + /// + /// Can insert stuff by clicking the storage entity with it. + /// + [DataField] + public bool ClickInsert = true; + + /// + /// Open the storage window when pressing E. + /// When false you can still open the inventory using verbs. + /// [DataField] - public bool ClickInsert = true; // Can insert stuff by clicking the storage entity with it + public bool OpenOnActivate = true; /// /// How many entities area pickup can pickup at once. diff --git a/Resources/Prototypes/Entities/Mobs/Species/slime.yml b/Resources/Prototypes/Entities/Mobs/Species/slime.yml index 56acf52fb7..469a92092d 100644 --- a/Resources/Prototypes/Entities/Mobs/Species/slime.yml +++ b/Resources/Prototypes/Entities/Mobs/Species/slime.yml @@ -15,6 +15,7 @@ # they like eat it idk lol - type: Storage clickInsert: false + openOnActivate: false grid: - 0,0,1,2 maxItemSize: Large -- 2.51.2