diff --git a/code/modules/mob/living/simple_animal/bot/cleanbot.dm b/code/modules/mob/living/simple_animal/bot/cleanbot.dm index b70547b917..bc8dd0c3ab 100644 --- a/code/modules/mob/living/simple_animal/bot/cleanbot.dm +++ b/code/modules/mob/living/simple_animal/bot/cleanbot.dm @@ -148,9 +148,14 @@ if(loc == get_turf(target)) if(!(check_bot(target) && prob(50))) //Target is not defined at the parent. 50% chance to still try and clean so we dont get stuck on the last blood drop. UnarmedAttack(target) //Rather than check at every step of the way, let's check before we do an action, so we can rescan before the other bot. + if(QDELETED(target)) //We done here. + target = null + mode = BOT_IDLE + return else shuffle = TRUE //Shuffle the list the next time we scan so we dont both go the same way. path = list() + if(!path || path.len == 0) //No path, need a new one //Try to produce a path to the target, and ignore airlocks to which it has access. path = get_path_to(src, target.loc, /turf/proc/Distance_cardinal, 0, 30, id=access_card)