From 2b3cf3f6d2c4e04692934b231367b31ffcf668cf Mon Sep 17 00:00:00 2001 From: Birdtalon Date: Fri, 24 Nov 2023 10:13:46 +0000 Subject: [PATCH] Fixes runtime with fire extinguisher cabinets on lifeboats (#5009) # About the pull request Fixes #3998 Fire extinguisher cabinets now new() a fire extinguisher properly in `Intialize()` # Explain why it's good for the game # Testing Photographs and Procedure
Screenshots & Videos Put screenshots and videos here with an empty line between the screenshots and the `
` tags.
# Changelog :cl: fix: Lifeboats fire extinguisher runtime. /:cl: --- code/game/objects/structures/extinguisher.dm | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/code/game/objects/structures/extinguisher.dm b/code/game/objects/structures/extinguisher.dm index 7b54f0447fae..e4ee4a1b662b 100644 --- a/code/game/objects/structures/extinguisher.dm +++ b/code/game/objects/structures/extinguisher.dm @@ -5,13 +5,15 @@ icon_state = "extinguisher" anchored = TRUE density = FALSE - var/obj/item/tool/extinguisher/has_extinguisher = new/obj/item/tool/extinguisher + var/obj/item/tool/extinguisher/has_extinguisher var/opened = 0 var/base_icon /obj/structure/extinguisher_cabinet/Initialize() . = ..() base_icon = initial(icon_state) + has_extinguisher = new /obj/item/tool/extinguisher() + has_extinguisher.forceMove(src) /obj/structure/extinguisher_cabinet/lifeboat name = "extinguisher cabinet" @@ -21,15 +23,15 @@ /obj/structure/extinguisher_cabinet/alt icon_state = "extinguisher_alt" -/obj/structure/extinguisher_cabinet/attackby(obj/item/O, mob/user) +/obj/structure/extinguisher_cabinet/attackby(obj/item/item, mob/user) if(isrobot(user)) return - if(istype(O, /obj/item/tool/extinguisher)) + if(istype(item, /obj/item/tool/extinguisher)) if(!has_extinguisher && opened) user.drop_held_item() - contents += O - has_extinguisher = O - to_chat(user, SPAN_NOTICE("You place [O] in [src].")) + item.forceMove(src) + has_extinguisher = item + to_chat(user, SPAN_NOTICE("You place [item] in [src].")) else opened = !opened else @@ -45,7 +47,7 @@ user.put_in_hands(has_extinguisher) to_chat(user, SPAN_NOTICE("You take [has_extinguisher] from [src].")) has_extinguisher = null - opened = 1 + opened = TRUE else opened = !opened update_icon()