diff --git a/code/datums/elements/polychromic.dm b/code/datums/elements/polychromic.dm index 1c438c86c5..f0938ca022 100644 --- a/code/datums/elements/polychromic.dm +++ b/code/datums/elements/polychromic.dm @@ -62,6 +62,7 @@ RegisterSignal(A, COMSIG_ITEM_WORN_OVERLAYS, .proc/apply_worn_overlays) if(suits_with_helmet_typecache[A.type]) RegisterSignal(A, COMSIG_SUIT_MADE_HELMET, .proc/register_helmet) + register_helmet(A) //just call it directly it only needs to be called once, right? else if(_flags & POLYCHROMIC_ACTION && ismob(A)) //in the event mob update icon procs are ever standarized. var/datum/action/polychromic/P = new(A) RegisterSignal(P, COMSIG_ACTION_TRIGGER, .proc/activate_action) @@ -165,7 +166,20 @@ /datum/element/polychromic/proc/on_examine(atom/source, mob/user, list/examine_list) examine_list += "Alt-click to recolor it." -/datum/element/polychromic/proc/register_helmet(atom/source, obj/item/clothing/head/H) +/datum/element/polychromic/proc/register_helmet(atom/source) + if(!isitem(source)) + return + + var/obj/item/clothing/head/H //going to just grab the headwear this way even if it may be inefficient + if(istype(source,/obj/item/clothing/suit/hooded)) //so how come it be like this, where toggleable headslots are named separately (helmet/hood) anyways? + var/obj/item/clothing/suit/hooded/sourcesuit = source + H = sourcesuit.hood + else if(istype(source,/obj/item/clothing/suit/space/hardsuit)) + var/obj/item/clothing/suit/space/hardsuit/sourcesuit = source + H = sourcesuit.helmet + else + return + suit_by_helmet[H] = source helmet_by_suit[source] = H colors_by_atom[H] = colors_by_atom[source]