From 7f9d721a72db361ddf40583b68c50c4148f1d0a9 Mon Sep 17 00:00:00 2001 From: AnturK Date: Fri, 12 Jan 2018 04:32:46 +0100 Subject: [PATCH] Fixes mobs on lavaland targeting through walls on wakeup (#34280) --- code/modules/mob/living/simple_animal/hostile/hostile.dm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/code/modules/mob/living/simple_animal/hostile/hostile.dm b/code/modules/mob/living/simple_animal/hostile/hostile.dm index 866c2f0463..e976efd288 100644 --- a/code/modules/mob/living/simple_animal/hostile/hostile.dm +++ b/code/modules/mob/living/simple_animal/hostile/hostile.dm @@ -476,12 +476,15 @@ mob/living/simple_animal/hostile/proc/DestroySurroundings() // for use with mega toggle_ai(AI_Z_OFF) return - if (isturf(T) && !is_station_level(T.z)) + var/cheap_search = isturf(T) && !is_station_level(T.z) + if (cheap_search) tlist = ListTargetsLazy(T.z) else tlist = ListTargets() if(AIStatus == AI_IDLE && FindTarget(tlist, 1)) + if(cheap_search) //Try again with full effort + FindTarget() toggle_ai(AI_ON) /mob/living/simple_animal/hostile/proc/ListTargetsLazy(var/_Z)//Step 1, find out what we can see