mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-19 03:55:11 +01:00
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:
@@ -1148,8 +1148,8 @@ About the new airlock wires panel:
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/door/airlock/CanAStarPass(obj/item/weapon/card/id/ID)
|
||||
//Airlock is passable if it is open (!density), bot has access, and is not bolted shut)
|
||||
return !density || (check_access(ID) && !locked)
|
||||
//Airlock is passable if it is open (!density), bot has access, and is not bolted shut or powered off)
|
||||
return !density || (check_access(ID) && !locked && hasPower())
|
||||
|
||||
/obj/machinery/door/airlock/HasProximity(atom/movable/AM as mob|obj)
|
||||
for (var/obj/A in contents)
|
||||
|
||||
@@ -87,7 +87,7 @@
|
||||
|
||||
//used in the AStar algorithm to determinate if the turf the door is on is passable
|
||||
/obj/machinery/door/window/CanAStarPass(obj/item/weapon/card/id/ID, to_dir)
|
||||
return !density || (dir != to_dir) || check_access(ID)
|
||||
return !density || (dir != to_dir) || (check_access(ID) && hasPower())
|
||||
|
||||
/obj/machinery/door/window/CheckExit(atom/movable/mover as mob|obj, turf/target)
|
||||
if(istype(mover) && mover.checkpass(PASSGLASS))
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -120,7 +120,7 @@ Actual Adjacent procs :
|
||||
//get adjacents turfs using the adjacent proc, checking for access with id
|
||||
var/list/L = call(cur.source,adjacent)(atom,id, simulated_only)
|
||||
for(var/turf/T in L)
|
||||
if(T == exclude || T in closed)
|
||||
if(T == exclude || (T in closed))
|
||||
continue
|
||||
|
||||
var/newg = cur.g + call(cur.source,dist)(T)
|
||||
|
||||
Reference in New Issue
Block a user