From fb26e82b334eb5efa51a20e3bdeb4b67a45df347 Mon Sep 17 00:00:00 2001 From: mistakenot4892 Date: Thu, 2 Apr 2026 13:22:59 +1100 Subject: [PATCH] Fixes runtime with hood override. --- code/modules/clothing/_clothing.dm | 15 ++++++++------- code/modules/clothing/suits/_suit_hood.dm | 2 +- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/code/modules/clothing/_clothing.dm b/code/modules/clothing/_clothing.dm index 6b7b48dca0f..f32b0b3ee2a 100644 --- a/code/modules/clothing/_clothing.dm +++ b/code/modules/clothing/_clothing.dm @@ -217,18 +217,19 @@ // Clothing does not generally align with each other's world icons, so we just use the mob overlay in this case. if(should_use_combined_accessory_appearance()) - var/image/I = get_mob_overlay(ismob(loc) ? loc : null, get_fallback_slot()) - if(I?.icon) // Null or invisible overlay, we don't want to make our clothing invisible just because it has an accessory. - icon = I.icon - icon_state = I.icon_state - underlays = I.underlays.Copy() + var/image/overlay_image = get_mob_overlay(ismob(loc) ? loc : null, get_fallback_slot()) + if(overlay_image?.icon) // Null or invisible overlay, we don't want to make our clothing invisible just because it has an accessory. + icon = overlay_image.icon + icon_state = overlay_image.icon_state + underlays = overlay_image.underlays.Copy() // we need to use the managed overlays system or else they will end up overwritten - set_overlays(I.overlays.Copy()) + set_overlays(overlay_image.overlays.Copy()) set_dir(SOUTH) update_clothing_icon() return - icon_state = JOINTEXT(list(get_world_inventory_state(), get_clothing_state_modifier())) + set_icon(initial(icon)) // this is not going to work correctly for custom icons + set_icon_state(JOINTEXT(list(get_world_inventory_state(), get_clothing_state_modifier()))) if(markings_state_modifier && markings_color) add_overlay(mutable_appearance(icon, "[icon_state][markings_state_modifier]", markings_color)) update_clothing_icon() diff --git a/code/modules/clothing/suits/_suit_hood.dm b/code/modules/clothing/suits/_suit_hood.dm index f9d99d17b60..1ac5049bb6e 100644 --- a/code/modules/clothing/suits/_suit_hood.dm +++ b/code/modules/clothing/suits/_suit_hood.dm @@ -20,7 +20,7 @@ // but that may change in the future /obj/item/clothing/suit/get_contained_external_atoms() . = ..() - if(istype(hood)) // this is considered a component rather than a contained item + if(islist(.) && istype(hood)) // this is considered a component rather than a contained item . -= hood /obj/item/clothing/suit/Initialize()