From 6372d8616adb508d9dc9e60a0661e7420ad689ef Mon Sep 17 00:00:00 2001 From: Jacquerel Date: Sat, 9 Sep 2023 17:57:18 +0100 Subject: [PATCH 1/2] Allows you to smoke cigarettes while not wearing a space helmet (#78202) ## About The Pull Request Fixes #78199 PR #78122 (ef44be8506fda5d4ff7e05822df4b120c6746b9e) was intended to allow you to smoke cigarettes in space if you have an oxygenated helmet on. What it _actually_ did was make it so you can _only_ smoke cigarettes if you have an oxygenated helmet on, regardless of whether or not you are in space (or if you inject them with liquid oxygen). I moved the shared check into a proc to reduce duplicate code and fixed the logic. ## Changelog :cl: fix: It is now possible to smoke cigarettes even if you aren't wearing a safety helmet /:cl: --- code/game/objects/items/cigs_lighters.dm | 40 +++++++++++------------- 1 file changed, 18 insertions(+), 22 deletions(-) diff --git a/code/game/objects/items/cigs_lighters.dm b/code/game/objects/items/cigs_lighters.dm index 883df152d9f3..b3dd4b330beb 100644 --- a/code/game/objects/items/cigs_lighters.dm +++ b/code/game/objects/items/cigs_lighters.dm @@ -219,22 +219,27 @@ CIGARETTE PACKETS ARE IN FANCY.DM if(!lighting_text) return ..() - var/mob/living/carbon/carbuser = user - - if(!istype(carbuser)) - carbuser = null - - if(!reagents.has_reagent(/datum/reagent/oxygen)) //cigarettes need oxygen - var/datum/gas_mixture/air = return_air() - if(!air || !air.has_gas(/datum/gas/oxygen, 1) || !carbuser?.can_breathe_helmet()) //or oxygen on a tile to burn - to_chat(user, span_notice("Your [name] needs a source of oxygen to burn.")) - return ..() + if(!check_oxygen(user)) //cigarettes need oxygen + balloon_alert(user, "no air!") + return ..() if(smoketime > 0) light(lighting_text) else to_chat(user, span_warning("There is nothing to smoke!")) +/// Checks that we have enough air to smoke +/obj/item/clothing/mask/cigarette/proc/check_oxygen(mob/user) + if (reagents.has_reagent(/datum/reagent/oxygen)) + return TRUE + var/datum/gas_mixture/air = return_air() + if (!isnull(air) && air.has_gas(/datum/gas/oxygen, 1)) + return TRUE + if (!iscarbon(user)) + return FALSE + var/mob/living/carbon/the_smoker = user + return the_smoker.can_breathe_helmet() + /obj/item/clothing/mask/cigarette/afterattack(obj/item/reagent_containers/cup/glass, mob/user, proximity) . = ..() if(!proximity || lit) //can't dip if cigarette is lit (it will heat the reagents in the glass instead) @@ -370,18 +375,9 @@ CIGARETTE PACKETS ARE IN FANCY.DM var/turf/location = get_turf(src) user?.ignite_mob() - var/mob/living/carbon/carbuser - if(user) - carbuser = user - - if(carbuser && !istype(carbuser)) - carbuser = null - - if(!reagents.has_reagent(/datum/reagent/oxygen)) //cigarettes need oxygen - var/datum/gas_mixture/air = return_air() - if(!air || !air.has_gas(/datum/gas/oxygen, 1) || !carbuser?.can_breathe_helmet()) //or oxygen on a tile to burn - extinguish() - return + if(!check_oxygen(user)) + extinguish() + return location.pollute_turf(pollution_type, 5, POLLUTION_PASSIVE_EMITTER_CAP) From 662a8f5b88ce280e0e0468ab5577a90132093b35 Mon Sep 17 00:00:00 2001 From: Hatterhat <31829017+Hatterhat@users.noreply.github.com> Date: Mon, 9 Oct 2023 00:20:07 -0500 Subject: [PATCH 2/2] [NO GBP] you can hit tendrils in melee again (#78856) ## About The Pull Request adds an `else . = ..()` to spawner's attackby check so you can just break them with your crusher in case you need to be rid of it ## Why It's Good For The Game sometimes you just need to melee a spawner ## Changelog :cl: fix: Necropolis tendrils and other mining mob spawners can be hit in melee again. /:cl: --------- Co-authored-by: Hatterhat --- code/game/objects/structures/spawner.dm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/code/game/objects/structures/spawner.dm b/code/game/objects/structures/spawner.dm index 0a22f5224e8d..29a63b1bff80 100644 --- a/code/game/objects/structures/spawner.dm +++ b/code/game/objects/structures/spawner.dm @@ -40,8 +40,12 @@ . += span_notice("It looks like you could probably scan and tag it with a [scanner_descriptor].") /obj/structure/spawner/attackby(obj/item/item, mob/user, params) + . = ..() + if(.) + return TRUE if(scanner_taggable && is_type_in_list(item, scanner_types)) gps_tag(user) + return TRUE /// Tag the spawner, prefixing its GPS entry with an identifier - or giving it one, if nonexistent. /obj/structure/spawner/proc/gps_tag(mob/user)