From dfd642799c2479596e117f695667f0c8031a4913 Mon Sep 17 00:00:00 2001 From: DGamerL <108773801+DGamerL@users.noreply.github.com> Date: Tue, 4 Feb 2025 09:02:39 +0100 Subject: [PATCH] Cigar(ette) butts now stay in your mask sot when they burn out (#27989) * FINALLY * Try to fix linters --------- Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com> --- code/game/objects/items/weapons/cigs.dm | 4 ++++ code/modules/mob/living/carbon/carbon_procs.dm | 4 ++-- code/modules/mob/living/carbon/carbon_update_icons.dm | 5 +++-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/code/game/objects/items/weapons/cigs.dm b/code/game/objects/items/weapons/cigs.dm index d2fc883566f..ec4025086cc 100644 --- a/code/game/objects/items/weapons/cigs.dm +++ b/code/game/objects/items/weapons/cigs.dm @@ -290,6 +290,10 @@ LIGHTERS ARE IN LIGHTERS.DM var/mob/living/M = loc to_chat(M, "Your [name] goes out.") M.drop_item_to_ground(src, force = TRUE) //Force the un-equip so the overlays update + butt.slot_flags |= ITEM_SLOT_MASK // Temporarily allow it to go on masks + M.equip_to_slot_if_possible(butt, ITEM_SLOT_MASK) + butt.slot_flags &= ~ITEM_SLOT_MASK + STOP_PROCESSING(SSobj, src) qdel(src) diff --git a/code/modules/mob/living/carbon/carbon_procs.dm b/code/modules/mob/living/carbon/carbon_procs.dm index ee55d431d3c..4d15ad53a0a 100644 --- a/code/modules/mob/living/carbon/carbon_procs.dm +++ b/code/modules/mob/living/carbon/carbon_procs.dm @@ -1253,7 +1253,7 @@ so that different stomachs can handle things in different ways VB*/ if(istype(head, /obj/item/clothing/head)) var/obj/item/clothing/head/HT = head . += HT.tint - if(wear_mask) + if(istype(wear_mask)) . += wear_mask.tint var/obj/item/organ/internal/eyes/E = get_organ_slot("eyes") @@ -1272,7 +1272,7 @@ so that different stomachs can handle things in different ways VB*/ update_inv_wear_mask() /mob/living/carbon/wear_mask_update(obj/item/clothing/C, toggle_off = 1) - if(C.tint || initial(C.tint)) + if(istype(C) && (C.tint || initial(C.tint))) update_tint() update_inv_wear_mask() diff --git a/code/modules/mob/living/carbon/carbon_update_icons.dm b/code/modules/mob/living/carbon/carbon_update_icons.dm index 414130c96d5..494184c5299 100644 --- a/code/modules/mob/living/carbon/carbon_update_icons.dm +++ b/code/modules/mob/living/carbon/carbon_update_icons.dm @@ -62,8 +62,9 @@ update_observer_view(l_hand) /mob/living/carbon/update_inv_wear_mask() - if(istype(wear_mask, /obj/item/clothing/mask)) - update_hud_wear_mask(wear_mask) + if(!wear_mask) + return + update_hud_wear_mask(wear_mask) /mob/living/carbon/update_inv_back() if(client && hud_used && hud_used.inv_slots[ITEM_SLOT_2_INDEX(ITEM_SLOT_BACK)])