From a62dd54cf40938c19ee0dff6b14ec74b9d8c23d9 Mon Sep 17 00:00:00 2001 From: spookerton Date: Fri, 7 Oct 2022 11:32:35 +0100 Subject: [PATCH] implement suggested behavior for #8703 closes #8703 --- code/modules/mob/living/bot/bot.dm | 12 +++++++++--- code/modules/mob/living/bot/mulebot.dm | 2 +- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/code/modules/mob/living/bot/bot.dm b/code/modules/mob/living/bot/bot.dm index 9e91ceef50..dc55e668ce 100644 --- a/code/modules/mob/living/bot/bot.dm +++ b/code/modules/mob/living/bot/bot.dm @@ -249,11 +249,17 @@ ++frustration return -/mob/living/bot/proc/handleFrustrated(var/targ) - obstacle = targ ? target_path[1] : patrol_path[1] + +/mob/living/bot/proc/handleFrustrated(has_target) + obstacle = null + if (has_target) + if (length(target_path)) + obstacle = target_path[1] + else if (length(patrol_path)) + obstacle = patrol_path[1] target_path = list() patrol_path = list() - return + /mob/living/bot/proc/lookForTargets() return diff --git a/code/modules/mob/living/bot/mulebot.dm b/code/modules/mob/living/bot/mulebot.dm index 56799adcb1..5a21f94695 100644 --- a/code/modules/mob/living/bot/mulebot.dm +++ b/code/modules/mob/living/bot/mulebot.dm @@ -187,7 +187,7 @@ flick("mulebot-emagged", src) update_icons() -/mob/living/bot/mulebot/handleFrustrated() +/mob/living/bot/mulebot/handleFrustrated(has_target) custom_emote(2, "makes a sighing buzz.") playsound(src, 'sound/machines/buzz-sigh.ogg', 50, 0) ..()