From a68e6ec783cc85a8f0d0bbc45556a5f071296db0 Mon Sep 17 00:00:00 2001 From: mikomyazaki <47489928+mikomyazaki@users.noreply.github.com> Date: Fri, 20 Nov 2020 13:37:13 +0000 Subject: [PATCH] Can no longer cut the bolt cover and the bolts at once. (#10601) --- code/game/machinery/doors/airlock.dm | 49 ++++++++++---------- html/changelogs/airlock_bolt_cutting_fix.yml | 41 ++++++++++++++++ 2 files changed, 66 insertions(+), 24 deletions(-) create mode 100644 html/changelogs/airlock_bolt_cutting_fix.yml diff --git a/code/game/machinery/doors/airlock.dm b/code/game/machinery/doors/airlock.dm index 624c0568386..f6f514b3c69 100644 --- a/code/game/machinery/doors/airlock.dm +++ b/code/game/machinery/doors/airlock.dm @@ -983,7 +983,7 @@ About the new airlock wires panel: var/cut_sound var/cutting = FALSE - if(istype(tool,/obj/item/weldingtool)) + if(tool.iswelder()) var/obj/item/weldingtool/WT = tool if(!WT.isOn()) return @@ -1029,37 +1029,38 @@ About the new airlock wires panel: return FALSE /obj/machinery/door/airlock/proc/cut_procedure(var/mob/user, var/cut_delay, var/cut_verb, var/cut_sound) - if(src.bolt_cut_state == BOLTS_FINE) + var/initial_state = bolt_cut_state + if(initial_state == BOLTS_FINE) to_chat(user, "You begin [cut_verb] through the bolt panel.") - else if(src.bolt_cut_state == BOLTS_EXPOSED) + else if(initial_state == BOLTS_EXPOSED) to_chat(user, "You begin [cut_verb] through the door bolts.") cut_delay *= 0.25 - var/i - for(i = 0; i < 4; i += 1) - if(i == 0) - if(do_after(user, cut_delay, src)) - to_chat(user, SPAN_NOTICE("You're a quarter way through.")) - playsound(src, cut_sound, 100, 1) - else if(i == 1) - if(do_after(user, cut_delay, src)) - to_chat(user, SPAN_NOTICE("You're halfway through.")) - playsound(src, cut_sound, 100, 1) - else if(i == 2) + if(do_after(user, cut_delay, src)) + to_chat(user, SPAN_NOTICE("You're a quarter way through.")) + playsound(src, cut_sound, 100, 1) + + if(do_after(user, cut_delay, src)) + to_chat(user, SPAN_NOTICE("You're halfway through.")) + playsound(src, cut_sound, 100, 1) + if(do_after(user, cut_delay, src)) to_chat(user, SPAN_NOTICE("You're three quarters through.")) playsound(src, cut_sound, 100, 1) - else if(i == 3) - if(do_after(user, cut_delay, src)) - playsound(src, cut_sound, 100, 1) - if(src.bolt_cut_state == BOLTS_FINE) - to_chat(user, SPAN_NOTICE("You remove the cover and expose the door bolts.")) - src.bolt_cut_state = BOLTS_EXPOSED - else if(src.bolt_cut_state == BOLTS_EXPOSED) - to_chat(user, SPAN_NOTICE("You sever the door bolts, unlocking the door.")) - src.bolt_cut_state = BOLTS_CUT - src.unlock(TRUE) //force it + + if(do_after(user, cut_delay, src)) + playsound(src, cut_sound, 100, 1) + + if(initial_state != bolt_cut_state) + return + if(initial_state == BOLTS_FINE) + to_chat(user, SPAN_NOTICE("You remove the cover and expose the door bolts.")) + src.bolt_cut_state = BOLTS_EXPOSED + else if(initial_state == BOLTS_EXPOSED) + to_chat(user, SPAN_NOTICE("You sever the door bolts, unlocking the door.")) + src.bolt_cut_state = BOLTS_CUT + src.unlock(TRUE) //force it /obj/machinery/door/airlock/CanUseTopic(var/mob/user) if(isobserver(user) && check_rights(R_ADMIN, FALSE, user)) diff --git a/html/changelogs/airlock_bolt_cutting_fix.yml b/html/changelogs/airlock_bolt_cutting_fix.yml new file mode 100644 index 00000000000..72c26bc9979 --- /dev/null +++ b/html/changelogs/airlock_bolt_cutting_fix.yml @@ -0,0 +1,41 @@ +################################ +# Example Changelog File +# +# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb. +# +# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.) +# When it is, any changes listed below will disappear. +# +# Valid Prefixes: +# bugfix +# wip (For works in progress) +# tweak +# soundadd +# sounddel +# rscadd (general adding of nice things) +# rscdel (general deleting of nice things) +# imageadd +# imagedel +# maptweak +# spellcheck (typo fixes) +# experiment +# balance +# admin +# backend +# security +# refactor +################################# + +# Your name. +author: mikomyazaki + +# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again. +delete-after: True + +# Any changes you've made. See valid prefix list above. +# INDENT WITH TWO SPACES. NOT TABS. SPACES. +# SCREW THIS UP AND IT WON'T WORK. +# Also, all entries are changed into a single [] after a master changelog generation. Just remove the brackets when you add new entries. +# Please surround your changes in double quotes ("), as certain characters otherwise screws up compiling. The quotes will not show up in the changelog. +changes: + - bugfix: "Using a welder on a broken airlock twice rapidly will no longer allow you to cut the cover for the bolts and the bolts simultaneously." \ No newline at end of file