From 6a9262d80d6dc54c1dc9399560a704dc43d2b2f3 Mon Sep 17 00:00:00 2001 From: Crazylemon64 Date: Thu, 7 Jan 2016 18:16:13 -0800 Subject: [PATCH] Sleepers now rotate nicely --- code/game/machinery/Sleeper.dm | 16 ++++----- code/game/machinery/adv_med.dm | 16 ++++----- .../crazylemon-rotatingsleepers.yml | 35 +++++++++++++++++++ 3 files changed, 51 insertions(+), 16 deletions(-) create mode 100644 html/changelogs/crazylemon-rotatingsleepers.yml diff --git a/code/game/machinery/Sleeper.dm b/code/game/machinery/Sleeper.dm index bc4b732d047..573b6580253 100644 --- a/code/game/machinery/Sleeper.dm +++ b/code/game/machinery/Sleeper.dm @@ -57,14 +57,14 @@ return /obj/machinery/sleep_console/proc/findsleeper() - spawn( 5 ) - var/obj/machinery/sleeper/sleepernew = null - // Loop through every direction - for(dir in list(NORTH,EAST,SOUTH,WEST)) - // Try to find a scanner in that direction - sleepernew = locate(/obj/machinery/sleeper, get_step(src, dir)) - src.connected = sleepernew - return + var/obj/machinery/sleeper/sleepernew = null + // Loop through every direction + for(dir in list(NORTH,EAST,SOUTH,WEST)) + // Try to find a scanner in that direction + var/temp = locate(/obj/machinery/sleeper, get_step(src, dir)) + if(!isnull(temp)) + sleepernew = temp + src.connected = sleepernew return /obj/machinery/sleeper/attack_animal(var/mob/living/simple_animal/M)//Stop putting hostile mobs in things guise diff --git a/code/game/machinery/adv_med.dm b/code/game/machinery/adv_med.dm index 157aebc4bc6..ac0b901ddbf 100644 --- a/code/game/machinery/adv_med.dm +++ b/code/game/machinery/adv_med.dm @@ -250,14 +250,14 @@ qdel(src) /obj/machinery/body_scanconsole/proc/findscanner() - spawn( 5 ) - var/obj/machinery/bodyscanner/bodyscannernew = null - // Loop through every direction - for(dir in list(NORTH,EAST,SOUTH,WEST)) - // Try to find a scanner in that direction - bodyscannernew = locate(/obj/machinery/bodyscanner, get_step(src, dir)) - src.connected = bodyscannernew - return + var/obj/machinery/bodyscanner/bodyscannernew = null + // Loop through every direction + for(dir in list(NORTH,EAST,SOUTH,WEST)) + // Try to find a scanner in that direction + var/temp = locate(/obj/machinery/bodyscanner, get_step(src, dir)) + if(!isnull(temp)) + bodyscannernew = temp + src.connected = bodyscannernew return diff --git a/html/changelogs/crazylemon-rotatingsleepers.yml b/html/changelogs/crazylemon-rotatingsleepers.yml new file mode 100644 index 00000000000..d78343eda37 --- /dev/null +++ b/html/changelogs/crazylemon-rotatingsleepers.yml @@ -0,0 +1,35 @@ +################################ +# 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 +# spellcheck (typo fixes) +# experiment +################################# + +# Your name. Remove the quotation mark and put in your name when copy+pasting the example changelog. +author: Crazylemon + +# 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, this gets changed to [] after reading. Just remove the brackets when you add new shit. +# Please surround your changes in double quotes ("). It works without them, but if you use certain characters it screws up compiling. The quotes will not show up in the changelog. +changes: + - bugfix: "Sleepers and Body Scanners will now reliably work when rotated"