Update files
This commit is contained in:
+23
-1
@@ -44,7 +44,7 @@
|
||||
* Note that this can only be used inside the [datum/pathfind][pathfind datum] since it uses variables from said datum.
|
||||
* If you really want to optimize things, optimize this, cuz this gets called a lot.
|
||||
*/
|
||||
#define CAN_STEP(cur_turf, next) (next && !next.density && cur_turf.Adjacent(next) && !(simulated_only && SSpathfinder.space_type_cache[next.type]) && !cur_turf.LinkBlockedWithAccess(next,caller, id) && (next != avoid))
|
||||
#define CAN_STEP(cur_turf, next) (next && !next.density && !(simulated_only && SSpathfinder.space_type_cache[next.type]) && !cur_turf.LinkBlockedWithAccess(next,caller, id) && (next != avoid))
|
||||
/// Another helper macro for JPS, for telling when a node has forced neighbors that need expanding
|
||||
#define STEP_NOT_HERE_BUT_THERE(cur_turf, dirA, dirB) ((!CAN_STEP(cur_turf, get_step(cur_turf, dirA)) && CAN_STEP(cur_turf, get_step(cur_turf, dirB))))
|
||||
|
||||
@@ -338,8 +338,21 @@
|
||||
* * simulated_only: Do we only worry about turfs with simulated atmos, most notably things that aren't space?
|
||||
*/
|
||||
/turf/proc/LinkBlockedWithAccess(turf/destination_turf, caller, ID)
|
||||
if(destination_turf.x != x && destination_turf.y != y) //diagonal
|
||||
var/in_dir = get_dir(destination_turf,src) // eg. northwest (1+8) = 9 (00001001)
|
||||
var/first_step_direction_a = in_dir & 3 // eg. north (1+8)&3 (0000 0011) = 1 (0000 0001)
|
||||
var/first_step_direction_b = in_dir & 12 // eg. west (1+8)&12 (0000 1100) = 8 (0000 1000)
|
||||
|
||||
for(var/first_step_direction in list(first_step_direction_a,first_step_direction_b))
|
||||
var/turf/midstep_turf = get_step(destination_turf,first_step_direction)
|
||||
var/way_blocked = LinkBlockedWithAccess(midstep_turf,caller,ID) || midstep_turf.LinkBlockedWithAccess(destination_turf,caller,ID)
|
||||
if(!way_blocked)
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
var/actual_dir = get_dir(src, destination_turf)
|
||||
|
||||
// Source border object checks
|
||||
for(var/obj/structure/window/iter_window in src)
|
||||
if(!iter_window.CanAStarPass(ID, actual_dir))
|
||||
return TRUE
|
||||
@@ -348,6 +361,15 @@
|
||||
if(!iter_windoor.CanAStarPass(ID, actual_dir))
|
||||
return TRUE
|
||||
|
||||
for(var/obj/structure/railing/iter_rail in src)
|
||||
if(!iter_rail.CanAStarPass(ID, actual_dir))
|
||||
return TRUE
|
||||
|
||||
for(var/obj/machinery/door/firedoor/border_only/firedoor in src)
|
||||
if(!firedoor.CanAStarPass(ID, actual_dir))
|
||||
return TRUE
|
||||
|
||||
// Destination blockers check
|
||||
var/reverse_dir = get_dir(destination_turf, src)
|
||||
for(var/obj/iter_object in destination_turf)
|
||||
if(!iter_object.CanAStarPass(ID, reverse_dir, caller))
|
||||
|
||||
Reference in New Issue
Block a user