-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
refactor is_blocked_turf #29324
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
refactor is_blocked_turf #29324
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -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)) | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
for(var/turf/T in orange(7)) | ||||||
if(isspaceturf(T)) | ||||||
continue | ||||||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -1053,7 +1053,7 @@ | |||||
|
||||||
var/has_tried_to_move = FALSE | ||||||
|
||||||
if(is_blocked_turf(target_turf, TRUE, excluded_objs = list(src))) | ||||||
if(target_turf.is_blocked_turf(exclude_mobs = TRUE, ignore_atoms = list(src))) | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
has_tried_to_move = TRUE | ||||||
if(!Move(target_turf, crush_dir)) | ||||||
// we'll try to move, and if we didn't end up going anywhere, then we do nothing. | ||||||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -180,7 +180,7 @@ | |||||
|
||||||
/obj/effect/spawner/random/proc/has_unblocked_line(destination) | ||||||
for(var/turf/potential_blockage as anything in get_line(get_turf(src), destination)) | ||||||
if(!is_blocked_turf(potential_blockage, exclude_mobs = TRUE)) | ||||||
if(!potential_blockage.is_blocked_turf(exclude_mobs = TRUE)) | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
continue | ||||||
return FALSE | ||||||
return TRUE |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -82,7 +82,7 @@ | |||||
return | ||||||
var/turf/T = get_turf(target) | ||||||
|
||||||
if(is_blocked_turf(T, TRUE)) //can't put mines on a tile that has dense stuff | ||||||
if(T.is_blocked_turf(exclude_mobs = TRUE)) //can't put mines on a tile that has dense stuff | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
to_chat(user, "<span class='notice'>The space is occupied! You cannot place a mine there!</span>") | ||||||
return | ||||||
if(!use(1)) //Can't place a landmine if you don't have a landmine | ||||||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -28,7 +28,7 @@ | |||||
to_chat(user, "<span class='notice'>You use [src] to deactivate [H].</span>") | ||||||
qdel(H) | ||||||
else | ||||||
if(!is_blocked_turf(T, TRUE)) //can't put holograms on a tile that has dense stuff | ||||||
if(!T.is_blocked_turf(exclude_mobs = TRUE)) //can't put holograms on a tile that has dense stuff | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
if(holocreator_busy) | ||||||
to_chat(user, "<span class='notice'>[src] is busy creating a hologram.</span>") | ||||||
return | ||||||
|
@@ -42,7 +42,7 @@ | |||||
holocreator_busy = FALSE | ||||||
if(length(signs) >= max_signs) | ||||||
return | ||||||
if(is_blocked_turf(T, TRUE)) //don't try to sneak dense stuff on our tile during the wait. | ||||||
if(T.is_blocked_turf(exclude_mobs = TRUE)) //don't try to sneak dense stuff on our tile during the wait. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
return | ||||||
H = new holosign_type(get_turf(target), src) | ||||||
to_chat(user, "<span class='notice'>You create [H] with [src].</span>") | ||||||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -512,7 +512,7 @@ | |||||
return | ||||||
var/list/turfs = list() | ||||||
for(var/turf/T in orange(1, get_turf(target))) | ||||||
if(is_blocked_turf(T, TRUE)) | ||||||
if(T.is_blocked_turf(exclude_mobs = TRUE)) | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
continue | ||||||
turfs += T | ||||||
|
||||||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -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)) | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
target_turf = candidate | ||||||
break | ||||||
if(target_turf) | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd personally lean towards leaving these args in place, it never hurts to be a little more verbose about what the arguments to a proc are