From 10ff77d2acf157a26db7739d54e8de3a2893b1a0 Mon Sep 17 00:00:00 2001 From: Kyle Spier-Swenson Date: Thu, 13 Jul 2017 14:09:36 -0700 Subject: [PATCH] Fixes astar pathing thru space when requested not to. --- code/__HELPERS/AStar.dm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/code/__HELPERS/AStar.dm b/code/__HELPERS/AStar.dm index 45b27590013..3cf4fb54ccd 100644 --- a/code/__HELPERS/AStar.dm +++ b/code/__HELPERS/AStar.dm @@ -154,10 +154,11 @@ Actual Adjacent procs : /turf/proc/reachableAdjacentTurfs(caller, ID, simulated_only) var/list/L = new() var/turf/T + var/static/space_type_cache = typecacheof(list(/turf/open/space)) for(var/dir in GLOB.cardinals) T = get_step(src,dir) - if(simulated_only && !istype(T)) + if(!T || (simulated_only && space_type_cache[T.type])) continue if(!T.density && !LinkBlockedWithAccess(T,caller, ID)) L.Add(T)