mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-28 06:27:26 +01:00
refactor is_blocked_turf (#29324)
This commit is contained in:
@@ -534,7 +534,7 @@
|
||||
/datum/syndicate_contract/proc/handle_target_return(mob/living/M)
|
||||
var/list/turf/possible_turfs = list()
|
||||
for(var/turf/T in contract.extraction_zone.contents)
|
||||
if(!isspaceturf(T) && !is_blocked_turf(T))
|
||||
if(!isspaceturf(T) && !T.is_blocked_turf())
|
||||
possible_turfs += T
|
||||
|
||||
var/turf/destination = length(possible_turfs) ? pick(possible_turfs) : pick(GLOB.latejoin)
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
var/list/candidate_turfs = get_area_turfs(impact_area)
|
||||
while(length(candidate_turfs))
|
||||
var/turf/candidate = pick_n_take(candidate_turfs)
|
||||
if(!is_blocked_turf(candidate,TRUE))
|
||||
if(!candidate.is_blocked_turf(exclude_mobs = TRUE))
|
||||
target_turf = candidate
|
||||
break
|
||||
if(target_turf)
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
if(!destination)
|
||||
continue
|
||||
for(var/turf/simulated/floor/F in destination.contents)
|
||||
if(!is_blocked_turf(F))
|
||||
if(!F.is_blocked_turf())
|
||||
turfs += F
|
||||
if(length(turfs))
|
||||
spawn_area_type = area_type
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
var/list/area_turfs = get_area_turfs(impact_area)
|
||||
while(length(area_turfs))
|
||||
var/turf/T = pick_n_take(area_turfs)
|
||||
if(is_blocked_turf(T))
|
||||
if(T.is_blocked_turf())
|
||||
continue
|
||||
|
||||
// Give ghosts some time to jump there before it begins.
|
||||
|
||||
@@ -95,7 +95,7 @@
|
||||
|
||||
var/list/locs = list()
|
||||
for(var/turf/T in oview(world.view, target))
|
||||
if(!is_blocked_turf(T))
|
||||
if(!T.is_blocked_turf())
|
||||
locs += T
|
||||
if(!length(locs))
|
||||
qdel(src)
|
||||
@@ -124,7 +124,7 @@
|
||||
// Find a spot for the scientist to spawn
|
||||
var/list/locs = list()
|
||||
for(var/turf/T in orange(1, target))
|
||||
if(!is_blocked_turf(T))
|
||||
if(!T.is_blocked_turf())
|
||||
locs += T
|
||||
locs -= get_turf(agent)
|
||||
if(!length(locs))
|
||||
@@ -278,7 +278,7 @@
|
||||
|
||||
var/list/locs = list()
|
||||
for(var/turf/T in oview(world.view / 2, target))
|
||||
if(!is_blocked_turf(T))
|
||||
if(!T.is_blocked_turf())
|
||||
locs += T
|
||||
if(!length(locs))
|
||||
qdel(src)
|
||||
@@ -357,7 +357,7 @@
|
||||
var/list/locs = list()
|
||||
for(var/turf/T in oview(world.view / 2, target))
|
||||
var/light_amount = T.get_lumcount()
|
||||
if(!is_blocked_turf(T) && light_amount <= 0.5)
|
||||
if(!T.is_blocked_turf() && light_amount <= 0.5)
|
||||
locs += T
|
||||
if(!length(locs))
|
||||
return INITIALIZE_HINT_QDEL
|
||||
|
||||
@@ -81,7 +81,7 @@
|
||||
|
||||
var/list/locs = list()
|
||||
for(var/turf/T in oview(world.view, target))
|
||||
if(!is_blocked_turf(T))
|
||||
if(!T.is_blocked_turf())
|
||||
locs += T
|
||||
if(!length(locs))
|
||||
qdel(src)
|
||||
@@ -195,7 +195,7 @@
|
||||
// Let's check if we can spawn somewhere first
|
||||
var/list/locs = list()
|
||||
for(var/turf/T in oview(world.view, target))
|
||||
if(isfloorturf(T) && !is_blocked_turf(T))
|
||||
if(isfloorturf(T) && !T.is_blocked_turf())
|
||||
locs += T
|
||||
if(!length(locs))
|
||||
qdel(src)
|
||||
@@ -257,7 +257,8 @@
|
||||
|
||||
var/list/vents = list()
|
||||
for(var/obj/machinery/atmospherics/unary/vent_pump/vent in oview(world.view, target))
|
||||
if(!is_blocked_turf(vent) && !vent.welded)
|
||||
var/turf/vent_turf = get_turf(vent)
|
||||
if(!vent_turf.is_blocked_turf() && !vent.welded)
|
||||
vents += vent
|
||||
if(!length(vents))
|
||||
qdel(src)
|
||||
@@ -320,7 +321,7 @@
|
||||
|
||||
var/list/locs = list()
|
||||
for(var/turf/T in oview(world.view, target))
|
||||
if(isfloorturf(T) && !is_blocked_turf(T))
|
||||
if(isfloorturf(T) && !T.is_blocked_turf())
|
||||
locs += T
|
||||
if(!length(locs))
|
||||
qdel(src)
|
||||
@@ -512,7 +513,7 @@
|
||||
|
||||
var/list/locs = list()
|
||||
for(var/turf/T in oview(world.view / 2, target))
|
||||
if(!is_blocked_turf(T))
|
||||
if(!T.is_blocked_turf())
|
||||
locs += T
|
||||
if(!length(locs))
|
||||
return INITIALIZE_HINT_QDEL
|
||||
|
||||
@@ -117,7 +117,7 @@
|
||||
var/turf/T = Stuff
|
||||
if((isspaceturf(T) || isfloorturf(T)) && NewTerrainFloors)
|
||||
var/turf/simulated/O = T.ChangeTurf(NewTerrainFloors, keep_icon = FALSE)
|
||||
if(prob(florachance) && length(NewFlora) && !is_blocked_turf(O))
|
||||
if(prob(florachance) && length(NewFlora) && !O.is_blocked_turf())
|
||||
var/atom/Picked = pick(NewFlora)
|
||||
new Picked(O)
|
||||
continue
|
||||
|
||||
@@ -167,7 +167,8 @@
|
||||
if(is_in_teleport_proof_area(beacon))
|
||||
to_chat(user, "<span class='warning'>[src] sparks and fizzles.</span>")
|
||||
return
|
||||
if(is_blocked_turf(get_turf(beacon), TRUE))
|
||||
var/turf/beacon_turf = get_turf(beacon)
|
||||
if(beacon_turf.is_blocked_turf(exclude_mobs = TRUE))
|
||||
to_chat(user, "<span class='warning'>The beacon is blocked by something, preventing teleportation!</span>")
|
||||
return
|
||||
if(!isturf(user.loc))
|
||||
@@ -184,7 +185,7 @@
|
||||
if(do_after(user, 40, target = user) && user && beacon)
|
||||
var/turf/T = get_turf(beacon)
|
||||
var/turf/source = get_turf(user)
|
||||
if(is_blocked_turf(T, TRUE))
|
||||
if(T.is_blocked_turf(exclude_mobs = TRUE))
|
||||
teleporting = FALSE
|
||||
to_chat(user, "<span class='warning'>The beacon is blocked by something, preventing teleportation!</span>")
|
||||
user.update_action_buttons_icon()
|
||||
@@ -205,7 +206,7 @@
|
||||
if(beacon)
|
||||
beacon.icon_state = "hierophant_tele_off"
|
||||
return
|
||||
if(is_blocked_turf(T, TRUE))
|
||||
if(T.is_blocked_turf(exclude_mobs = TRUE))
|
||||
teleporting = FALSE
|
||||
to_chat(user, "<span class='warning'>The beacon is blocked by something, preventing teleportation!</span>")
|
||||
user.update_action_buttons_icon()
|
||||
@@ -240,7 +241,7 @@
|
||||
|
||||
/obj/item/hierophant_club/proc/teleport_mob(turf/source, mob/M, turf/target, mob/user)
|
||||
var/turf/turf_to_teleport_to = get_step(target, get_dir(source, M)) //get position relative to caster
|
||||
if(!turf_to_teleport_to || is_blocked_turf(turf_to_teleport_to, TRUE))
|
||||
if(!turf_to_teleport_to || turf_to_teleport_to.is_blocked_turf(exclude_mobs = TRUE))
|
||||
return
|
||||
if(SEND_SIGNAL(M, COMSIG_MOVABLE_TELEPORTING, turf_to_teleport_to) & COMPONENT_BLOCK_TELEPORT)
|
||||
return FALSE
|
||||
|
||||
@@ -683,7 +683,7 @@
|
||||
for(var/distance in 0 to 8)
|
||||
var/turf/current_dash_target = dash_target
|
||||
current_dash_target = get_step(current_dash_target, user.dir)
|
||||
if(!is_blocked_turf(current_dash_target, TRUE))
|
||||
if(!current_dash_target.is_blocked_turf(exclude_mobs = TRUE))
|
||||
dash_target = current_dash_target
|
||||
else
|
||||
break
|
||||
|
||||
@@ -133,7 +133,7 @@
|
||||
var/list/possible_turfs = get_adjacent_open_turfs(target)
|
||||
shuffle_inplace(possible_turfs)
|
||||
for(var/turf/possible_turf as anything in possible_turfs)
|
||||
if(!is_blocked_turf(possible_turf))
|
||||
if(!possible_turf.is_blocked_turf())
|
||||
set_movement_target(controller, possible_turf)
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
@@ -133,7 +133,7 @@
|
||||
adjustToxLoss(-3)
|
||||
|
||||
T = get_step(T, dir)
|
||||
if(is_blocked_turf(T))
|
||||
if(T.is_blocked_turf())
|
||||
break
|
||||
|
||||
/mob/living/carbon/gib()
|
||||
|
||||
@@ -65,7 +65,7 @@
|
||||
for(var/turf/T in target_turfs)
|
||||
if(isspaceturf(T))
|
||||
continue
|
||||
if(is_blocked_turf(T))
|
||||
if(T.is_blocked_turf())
|
||||
continue
|
||||
if(T.x > world.maxx - 5 || T.x < 5)
|
||||
continue //putting them at the edge is dumb
|
||||
|
||||
@@ -118,7 +118,8 @@
|
||||
movable_target.forceMove(src)
|
||||
return COMPONENT_CANCEL_ATTACK_CHAIN
|
||||
|
||||
if(isturf(target) && !is_blocked_turf(target) && LAZYLEN(crates_in_hand))
|
||||
var/turf/target_turf = target
|
||||
if(istype(target_turf) && !target_turf.is_blocked_turf() && LAZYLEN(crates_in_hand))
|
||||
drop_random_crate(target)
|
||||
return COMPONENT_CANCEL_ATTACK_CHAIN
|
||||
|
||||
|
||||
@@ -246,7 +246,7 @@ Difficulty: Medium
|
||||
if(get_dist(src, O) >= MINER_DASH_RANGE && turf_dist_to_target <= self_dist_to_target && !islava(O) && !ischasm(O))
|
||||
var/valid = TRUE
|
||||
for(var/turf/T in get_line(own_turf, O))
|
||||
if(is_blocked_turf(T, TRUE))
|
||||
if(T.is_blocked_turf(exclude_mobs = TRUE))
|
||||
valid = FALSE
|
||||
continue
|
||||
if(valid)
|
||||
|
||||
@@ -896,7 +896,7 @@
|
||||
|
||||
H.forceMove(P)
|
||||
else // if wasn't a pipe, then set loc to turf
|
||||
if(is_blocked_turf(T))
|
||||
if(T.is_blocked_turf())
|
||||
H.forceMove(loc)
|
||||
else
|
||||
H.forceMove(T)
|
||||
|
||||
@@ -120,7 +120,7 @@
|
||||
GLOB.major_announcement.Announce("We were unable to find an orderer. We have sent the beacon placer to the Cargo Office.", "Shuttle Purchase Receipt")
|
||||
var/list/L = list()
|
||||
for(var/turf/T in get_area_turfs(/area/station/supply/office))
|
||||
if(is_blocked_turf(T))
|
||||
if(T.is_blocked_turf())
|
||||
continue
|
||||
L.Add(T)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user