From a81942408846c0a520a2f4e5c7e9dc0717a8b22b Mon Sep 17 00:00:00 2001 From: Putnam3145 Date: Wed, 30 Mar 2022 14:53:58 -0700 Subject: [PATCH 1/6] Fixes recycler runtime on emergency stop --- code/game/machinery/recycler.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/game/machinery/recycler.dm b/code/game/machinery/recycler.dm index 21ef8e2dcf..3cfac29749 100644 --- a/code/game/machinery/recycler.dm +++ b/code/game/machinery/recycler.dm @@ -123,7 +123,7 @@ living_detected = living_detected || AM nom += AM else if(isliving(AM)) - living_detected = living_detected || TRUE + living_detected = living_detected || AM crunchy_nom += AM var/not_eaten = to_eat.len - nom.len - crunchy_nom.len if(living_detected) // First, check if we have any living beings detected. From 06bda8946adf37d6cd1a10cb0d25e2fe52f035e9 Mon Sep 17 00:00:00 2001 From: Putnam3145 Date: Wed, 30 Mar 2022 14:55:15 -0700 Subject: [PATCH 2/6] wait, no, that's Lua-like, not even right --- code/game/machinery/recycler.dm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/game/machinery/recycler.dm b/code/game/machinery/recycler.dm index 3cfac29749..4942873a9c 100644 --- a/code/game/machinery/recycler.dm +++ b/code/game/machinery/recycler.dm @@ -120,10 +120,10 @@ var/obj/item/bodypart/head/as_head = AM var/obj/item/mmi/as_mmi = AM if(istype(AM, /obj/item/organ/brain) || (istype(as_head) && as_head.brain) || (istype(as_mmi) && as_mmi.brain) || istype(AM, /obj/item/dullahan_relay)) - living_detected = living_detected || AM + living_detected = living_detected ? living_detected : AM nom += AM else if(isliving(AM)) - living_detected = living_detected || AM + living_detected = living_detected ? living_detected : AM crunchy_nom += AM var/not_eaten = to_eat.len - nom.len - crunchy_nom.len if(living_detected) // First, check if we have any living beings detected. From 06528b61ae67ab74a619b436f2c8268748958c2b Mon Sep 17 00:00:00 2001 From: SandPoot Date: Wed, 30 Mar 2022 22:32:58 -0300 Subject: [PATCH 3/6] Update files --- code/__HELPERS/path.dm | 24 ++++++++++++++++++- code/game/machinery/doors/firedoor.dm | 3 +++ .../mob/living/simple_animal/bot/bot.dm | 7 +----- 3 files changed, 27 insertions(+), 7 deletions(-) diff --git a/code/__HELPERS/path.dm b/code/__HELPERS/path.dm index 7ae72c3fa2..bac95fc296 100644 --- a/code/__HELPERS/path.dm +++ b/code/__HELPERS/path.dm @@ -44,7 +44,7 @@ * Note that this can only be used inside the [datum/pathfind][pathfind datum] since it uses variables from said datum. * If you really want to optimize things, optimize this, cuz this gets called a lot. */ -#define CAN_STEP(cur_turf, next) (next && !next.density && cur_turf.Adjacent(next) && !(simulated_only && SSpathfinder.space_type_cache[next.type]) && !cur_turf.LinkBlockedWithAccess(next,caller, id) && (next != avoid)) +#define CAN_STEP(cur_turf, next) (next && !next.density && !(simulated_only && SSpathfinder.space_type_cache[next.type]) && !cur_turf.LinkBlockedWithAccess(next,caller, id) && (next != avoid)) /// Another helper macro for JPS, for telling when a node has forced neighbors that need expanding #define STEP_NOT_HERE_BUT_THERE(cur_turf, dirA, dirB) ((!CAN_STEP(cur_turf, get_step(cur_turf, dirA)) && CAN_STEP(cur_turf, get_step(cur_turf, dirB)))) @@ -338,8 +338,21 @@ * * simulated_only: Do we only worry about turfs with simulated atmos, most notably things that aren't space? */ /turf/proc/LinkBlockedWithAccess(turf/destination_turf, caller, ID) + if(destination_turf.x != x && destination_turf.y != y) //diagonal + var/in_dir = get_dir(destination_turf,src) // eg. northwest (1+8) = 9 (00001001) + var/first_step_direction_a = in_dir & 3 // eg. north (1+8)&3 (0000 0011) = 1 (0000 0001) + var/first_step_direction_b = in_dir & 12 // eg. west (1+8)&12 (0000 1100) = 8 (0000 1000) + + for(var/first_step_direction in list(first_step_direction_a,first_step_direction_b)) + var/turf/midstep_turf = get_step(destination_turf,first_step_direction) + var/way_blocked = LinkBlockedWithAccess(midstep_turf,caller,ID) || midstep_turf.LinkBlockedWithAccess(destination_turf,caller,ID) + if(!way_blocked) + return FALSE + return TRUE + var/actual_dir = get_dir(src, destination_turf) + // Source border object checks for(var/obj/structure/window/iter_window in src) if(!iter_window.CanAStarPass(ID, actual_dir)) return TRUE @@ -348,6 +361,15 @@ if(!iter_windoor.CanAStarPass(ID, actual_dir)) return TRUE + for(var/obj/structure/railing/iter_rail in src) + if(!iter_rail.CanAStarPass(ID, actual_dir)) + return TRUE + + for(var/obj/machinery/door/firedoor/border_only/firedoor in src) + if(!firedoor.CanAStarPass(ID, actual_dir)) + return TRUE + + // Destination blockers check var/reverse_dir = get_dir(destination_turf, src) for(var/obj/iter_object in destination_turf) if(!iter_object.CanAStarPass(ID, reverse_dir, caller)) diff --git a/code/game/machinery/doors/firedoor.dm b/code/game/machinery/doors/firedoor.dm index d84b994b92..ba0c852cc6 100644 --- a/code/game/machinery/doors/firedoor.dm +++ b/code/game/machinery/doors/firedoor.dm @@ -355,6 +355,9 @@ else return TRUE +/obj/machinery/door/firedoor/border_only/CanAStarPass(obj/item/card/id/ID, to_dir) + return !density || (dir != to_dir) + /obj/machinery/door/firedoor/border_only/CheckExit(atom/movable/mover as mob|obj, turf/target) if(istype(mover) && (mover.pass_flags & PASSGLASS)) return TRUE diff --git a/code/modules/mob/living/simple_animal/bot/bot.dm b/code/modules/mob/living/simple_animal/bot/bot.dm index 3aec65f6fb..bac59ef2e0 100644 --- a/code/modules/mob/living/simple_animal/bot/bot.dm +++ b/code/modules/mob/living/simple_animal/bot/bot.dm @@ -285,7 +285,7 @@ call_mode() return if(BOT_SUMMON) //Called by PDA - bot_summon() + summon_step() return return TRUE //Successful completion. Used to prevent child process() continuing if this one is ended early. @@ -731,8 +731,6 @@ Pass a positive integer as an argument to override a bot's default speed. mode = BOT_SUMMON speak("Responding.", radio_channel) - calc_summon_path() - if("ejectpai") ejectpairemote(user) return @@ -759,9 +757,6 @@ Pass a positive integer as an argument to override a bot's default speed. else to_chat(src, "Unidentified control sequence received:[command]") -/mob/living/simple_animal/bot/proc/bot_summon() // summoned to PDA - summon_step() - // calculates a path to the current destination // given an optional turf to avoid /mob/living/simple_animal/bot/proc/calc_path(turf/avoid) From fb69f6426d7a675e7dbf879553cfde2c40be7d87 Mon Sep 17 00:00:00 2001 From: CitadelStationBot Date: Sat, 2 Apr 2022 02:17:05 -0500 Subject: [PATCH 4/6] Automatic changelog generation for PR #15578 [ci skip] --- html/changelogs/AutoChangeLog-pr-15578.yml | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 html/changelogs/AutoChangeLog-pr-15578.yml diff --git a/html/changelogs/AutoChangeLog-pr-15578.yml b/html/changelogs/AutoChangeLog-pr-15578.yml new file mode 100644 index 0000000000..64256eb9ef --- /dev/null +++ b/html/changelogs/AutoChangeLog-pr-15578.yml @@ -0,0 +1,4 @@ +author: "SandPoot" +delete-after: True +changes: + - bugfix: "Fixes some diagonal weirdness that might be going on with npcs." From 1a86c82a6db5674fd18a35eecfb14b92fbc3a138 Mon Sep 17 00:00:00 2001 From: CitadelStationBot Date: Sat, 2 Apr 2022 02:17:34 -0500 Subject: [PATCH 5/6] Automatic changelog generation for PR #15576 [ci skip] --- html/changelogs/AutoChangeLog-pr-15576.yml | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 html/changelogs/AutoChangeLog-pr-15576.yml diff --git a/html/changelogs/AutoChangeLog-pr-15576.yml b/html/changelogs/AutoChangeLog-pr-15576.yml new file mode 100644 index 0000000000..3d1e93050c --- /dev/null +++ b/html/changelogs/AutoChangeLog-pr-15576.yml @@ -0,0 +1,4 @@ +author: "Putnam3145" +delete-after: True +changes: + - bugfix: "recycler now emergency stops properly" From 4c3fa08cdff4abcd25cf918d2b8521c0b5f26226 Mon Sep 17 00:00:00 2001 From: Changelogs Date: Sun, 3 Apr 2022 00:42:55 +0000 Subject: [PATCH 6/6] Automatic changelog compile [ci skip] --- html/changelogs/AutoChangeLog-pr-15576.yml | 4 ---- html/changelogs/AutoChangeLog-pr-15578.yml | 4 ---- 2 files changed, 8 deletions(-) delete mode 100644 html/changelogs/AutoChangeLog-pr-15576.yml delete mode 100644 html/changelogs/AutoChangeLog-pr-15578.yml diff --git a/html/changelogs/AutoChangeLog-pr-15576.yml b/html/changelogs/AutoChangeLog-pr-15576.yml deleted file mode 100644 index 3d1e93050c..0000000000 --- a/html/changelogs/AutoChangeLog-pr-15576.yml +++ /dev/null @@ -1,4 +0,0 @@ -author: "Putnam3145" -delete-after: True -changes: - - bugfix: "recycler now emergency stops properly" diff --git a/html/changelogs/AutoChangeLog-pr-15578.yml b/html/changelogs/AutoChangeLog-pr-15578.yml deleted file mode 100644 index 64256eb9ef..0000000000 --- a/html/changelogs/AutoChangeLog-pr-15578.yml +++ /dev/null @@ -1,4 +0,0 @@ -author: "SandPoot" -delete-after: True -changes: - - bugfix: "Fixes some diagonal weirdness that might be going on with npcs."