Skip to content

Commit

Permalink
copys some tg code to fix the cleanbot fails
Browse files Browse the repository at this point in the history
  • Loading branch information
FalloutFalcon committed Jan 20, 2025
1 parent d0d8997 commit 5ca958f
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions code/modules/mob/living/simple_animal/bot/cleanbot.dm
Original file line number Diff line number Diff line change
Expand Up @@ -261,20 +261,18 @@
mode = BOT_IDLE
return

if(target && (!path || path.len == 0) && (get_dist(src,target) > 1))
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, 30, id=access_card)
mode = BOT_MOVING
if(!path.len) //try to get closer if you can't reach the target directly
path = get_path_to(src, target, 30, id=access_card)
if(!path.len) //Do not chase a target we cannot reach.
add_to_ignore(target)
target = null
path = list()

if(path.len > 0 && target)
if(!bot_move(path[path.len]))
if(!bot_move(target))
add_to_ignore(target)
target = null
mode = BOT_IDLE
path = list()
return
mode = BOT_MOVING
else if(!bot_move(target))
target = null
mode = BOT_IDLE
return

oldloc = loc
Expand Down

0 comments on commit 5ca958f

Please sign in to comment.