From d1ee8d117f86daa2f6a9240c34a5bc26d6982ec1 Mon Sep 17 00:00:00 2001 From: Meghan-Rossi <56671765+Meghan-Rossi@users.noreply.github.com> Date: Fri, 21 Aug 2020 03:31:57 +0100 Subject: [PATCH] Stop bots standing around blocking doors (#7509) * Idle bots will move out of doorways Idle bots will move out of doorways, including turfs with firedoors or blastdoors. * +changelog * fix parentheses --- code/modules/mob/living/bot/bot.dm | 6 ++++++ html/changelogs/meghan rossi - bots clear doorways.yml | 4 ++++ 2 files changed, 10 insertions(+) create mode 100644 html/changelogs/meghan rossi - bots clear doorways.yml diff --git a/code/modules/mob/living/bot/bot.dm b/code/modules/mob/living/bot/bot.dm index 0822dca375..30ff2c1d2c 100644 --- a/code/modules/mob/living/bot/bot.dm +++ b/code/modules/mob/living/bot/bot.dm @@ -197,6 +197,12 @@ else startPatrol() else + if((locate(/obj/machinery/door) in loc) && !pulledby) //Don't hang around blocking doors, but don't run off if someone tries to pull us through one. + var/turf/my_turf = get_turf(src) + var/list/can_go = my_turf.CardinalTurfsWithAccess(botcard) + if(LAZYLEN(can_go)) + if(step_towards(src, pick(can_go))) + return handleIdle() /mob/living/bot/proc/handleRegular() diff --git a/html/changelogs/meghan rossi - bots clear doorways.yml b/html/changelogs/meghan rossi - bots clear doorways.yml new file mode 100644 index 0000000000..87fe0d79be --- /dev/null +++ b/html/changelogs/meghan rossi - bots clear doorways.yml @@ -0,0 +1,4 @@ +author: Meghan Rossi +delete-after: True +changes: + - tweak: "Bots that are idle in doorways (including firedoors and blastdoors) will move out of the way." \ No newline at end of file