Fixes unpowered doors being ignored by AStar

Fixes avoid turf functionality
Makes mulebots only recalculate paths due to blockades only once per life tick.
This commit is contained in:
AnturK
2015-12-08 23:56:21 +01:00
parent 02fe4ec5a8
commit bc87752245
4 changed files with 8 additions and 10 deletions
@@ -515,7 +515,6 @@ mob/living/simple_animal/bot/mulebot/bot_reset()
if(refresh) update_controls()
/mob/living/simple_animal/bot/mulebot/proc/process_bot()
if(!on)
return
@@ -582,13 +581,13 @@ mob/living/simple_animal/bot/mulebot/bot_reset()
if(blockcount > 10) // attempt 10 times before recomputing
// find new path excluding blocked turf
buzz(SIGH)
spawn(2)
calc_path(next)
mode = BOT_WAIT_FOR_NAV
blockcount = 0
spawn(20)
calc_path(avoid=next)
if(path.len > 0)
buzz(DELIGHT)
mode = BOT_BLOCKED
mode = BOT_WAIT_FOR_NAV
return
return
else
@@ -622,7 +621,6 @@ mob/living/simple_animal/bot/mulebot/bot_reset()
/mob/living/simple_animal/bot/mulebot/calc_path(turf/avoid = null)
path = get_path_to(loc, target, src, /turf/proc/Distance_cardinal, 0, 250, id=access_card, exclude=avoid)
// sets the current destination
// signals all beacons matching the delivery code
// beacons will return a signal giving their locations