From 641c95f443e2078a3f168202c6285f1f19d99be2 Mon Sep 17 00:00:00 2001 From: themias <89101928+themias@users.noreply.github.com> Date: Thu, 14 Dec 2023 15:49:40 -0500 Subject: [PATCH] Fix spray nozzle (#22492) --- .../Weapons/Ranged/Systems/SharedGunSystem.Clothing.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Content.Shared/Weapons/Ranged/Systems/SharedGunSystem.Clothing.cs b/Content.Shared/Weapons/Ranged/Systems/SharedGunSystem.Clothing.cs index b9b21a4798..a144d96567 100644 --- a/Content.Shared/Weapons/Ranged/Systems/SharedGunSystem.Clothing.cs +++ b/Content.Shared/Weapons/Ranged/Systems/SharedGunSystem.Clothing.cs @@ -33,7 +33,11 @@ public partial class SharedGunSystem { slotEntity = null; - if (!_inventory.TryGetContainerSlotEnumerator(uid, out var enumerator, component.TargetSlot)) + if (!Containers.TryGetContainingContainer(uid, out var container)) + return false; + var user = container.Owner; + + if (!_inventory.TryGetContainerSlotEnumerator(user, out var enumerator, component.TargetSlot)) return false; while (enumerator.NextItem(out var item)) -- 2.51.2