From 56fddbf762487919dfd5112b8bff2807273612e8 Mon Sep 17 00:00:00 2001 From: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Date: Thu, 14 Oct 2021 22:20:36 +0200 Subject: [PATCH] [MIRROR] Fixes pipes not fulfulling nicotine withdrawal [MDB IGNORE] (#8823) * Fixes pipes not fulfulling nicotine withdrawal (#61993) Co-authored-by: seth-scherer * Fixes pipes not fulfulling nicotine withdrawal Co-authored-by: Seth Scherer Co-authored-by: seth-scherer --- code/game/objects/items/cigs_lighters.dm | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/code/game/objects/items/cigs_lighters.dm b/code/game/objects/items/cigs_lighters.dm index a793bf36ab0..b01c9e55ae8 100644 --- a/code/game/objects/items/cigs_lighters.dm +++ b/code/game/objects/items/cigs_lighters.dm @@ -582,24 +582,32 @@ CIGARETTE PACKETS ARE IN FANCY.DM return ..() /obj/item/clothing/mask/cigarette/pipe/process(delta_time) - var/turf/location = get_turf(src) - smoketime -= delta_time + if(isliving(loc)) + var/mob/living/living_smoker = loc + living_smoker.IgniteMob() + if(!reagents.has_reagent(/datum/reagent/oxygen)) //cigarettes need oxygen + var/datum/gas_mixture/air = return_air() + if(!air?.has_gas(/datum/gas/oxygen, 1)) //or oxygen on a tile to burn + extinguish() + return + + smoketime -= delta_time * (1 SECONDS) if(smoketime <= 0) - new /obj/effect/decal/cleanable/ash(location) if(ismob(loc)) - var/mob/living/M = loc - to_chat(M, span_notice("Your [name] goes out.")) + var/mob/living/living_smoker = loc + to_chat(living_smoker, span_notice("Your [name] goes out.")) lit = FALSE icon_state = icon_off inhand_icon_state = icon_off - M.update_inv_wear_mask() + living_smoker.update_inv_wear_mask() packeditem = FALSE name = "empty [initial(name)]" STOP_PROCESSING(SSobj, src) return open_flame(heat) - if(reagents?.total_volume) // check if it has any reagents at all + if(reagents?.total_volume && COOLDOWN_FINISHED(src, drag_cooldown)) + COOLDOWN_START(src, drag_cooldown, dragtime) handle_reagents() /obj/item/clothing/mask/cigarette/pipe/attackby(obj/item/thing, mob/user, params)