mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-24 12:37:26 +01:00
refactor is_blocked_turf (#29324)
This commit is contained in:
@@ -115,7 +115,7 @@
|
||||
var/turf/target_turf = get_step(our_turf, direction)
|
||||
if(isnull(target_turf))
|
||||
continue
|
||||
if(is_blocked_turf(target_turf) || get_dist(target_turf, target) > get_dist(living_pawn, target))
|
||||
if(target_turf.is_blocked_turf() || get_dist(target_turf, target) > get_dist(living_pawn, target))
|
||||
continue
|
||||
possible_turfs += target_turf
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
var/turf/return_turf
|
||||
for(var/i in 1 to run_distance)
|
||||
var/turf/test_destination = get_ranged_target_turf_direct(source, target, range = i, offset = angle)
|
||||
if(is_blocked_turf(test_destination, excluded_objs = GLOB.airlocks + src))
|
||||
if(test_destination.is_blocked_turf(source_atom = source, ignore_atoms = GLOB.airlocks))
|
||||
break
|
||||
return_turf = test_destination
|
||||
return return_turf
|
||||
|
||||
@@ -59,9 +59,13 @@
|
||||
for(var/turf/turf_in_view in view(2, get_turf(structure_parent)))
|
||||
if(!isfloorturf(turf_in_view))
|
||||
continue
|
||||
var/blocked_los = FALSE
|
||||
for(var/turf/potential_blockage as anything in get_line(get_turf(structure_parent), turf_in_view))
|
||||
if(!is_blocked_turf(potential_blockage, exclude_mobs = TRUE, excluded_objs = list(parent)))
|
||||
nearby_empty_tiles += turf_in_view
|
||||
if(potential_blockage.is_blocked_turf(exclude_mobs = TRUE, source_atom = parent))
|
||||
blocked_los = TRUE
|
||||
break
|
||||
if(!blocked_los)
|
||||
nearby_empty_tiles += turf_in_view
|
||||
|
||||
var/itemcount = 1
|
||||
for(var/obj/item/I in structure_parent.loc)
|
||||
|
||||
@@ -61,7 +61,7 @@
|
||||
sleep(jaunt_in_time)
|
||||
qdel(holder)
|
||||
if(!QDELETED(target))
|
||||
if(is_blocked_turf(mobloc, TRUE))
|
||||
if(mobloc.is_blocked_turf(exclude_mobs = TRUE))
|
||||
for(var/turf/T in orange(7))
|
||||
if(isspaceturf(T))
|
||||
continue
|
||||
|
||||
Reference in New Issue
Block a user