From 7feea724fd5a3be322575f9668eec9e0eca00af7 Mon Sep 17 00:00:00 2001 From: Leon Friedrich <60421075+ElectroJr@users.noreply.github.com> Date: Sun, 24 Apr 2022 03:35:46 +1200 Subject: [PATCH] Fix hardsuit helmet unequip (#7728) --- .../Clothing/EntitySystems/ToggleableClothingSystem.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Content.Shared/Clothing/EntitySystems/ToggleableClothingSystem.cs b/Content.Shared/Clothing/EntitySystems/ToggleableClothingSystem.cs index 0f1f6c9659..0aacc16802 100644 --- a/Content.Shared/Clothing/EntitySystems/ToggleableClothingSystem.cs +++ b/Content.Shared/Clothing/EntitySystems/ToggleableClothingSystem.cs @@ -71,7 +71,10 @@ public sealed class ToggleableClothingSystem : EntitySystem /// private void OnToggleableUnequip(EntityUid uid, ToggleableClothingComponent component, GotUnequippedEvent args) { - if (component.Container != null && component.Container.ContainedEntity != null && component.ClothingUid != null) + // If the attached clothing is not currently in the container, this just assumes that it is currently equipped. + // This should maybe double check that the entity currently in the slot is actually the attached clothing, but + // if its not, then something else has gone wrong already... + if (component.Container != null && component.Container.ContainedEntity == null && component.ClothingUid != null) _inventorySystem.TryUnequip(args.Equipee, component.Slot, force: true); }