Fix hardsuit helmet unequip (#7728)

This commit is contained in:
Leon Friedrich
2022-04-24 03:35:46 +12:00
committed by GitHub
parent ef4ad4ff7b
commit 7feea724fd

View File

@@ -71,7 +71,10 @@ public sealed class ToggleableClothingSystem : EntitySystem
/// </summary>
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);
}