Skip to content
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

Fixes picking up and dragging items from z-levels below #33583

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions code/_onclick/adjacent.dm
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
if(T0 == src) //same turf
return 1

if(get_dist(src, T0) > 1) //too far
if(get_z_dist(src, T0) > 1 || (src.z != T0.z && !(locate(/obj/structure/stairs) in src) && !(locate(/obj/structure/stairs) in T0))) //too far
continue

// Non diagonal case
Expand Down Expand Up @@ -157,4 +157,4 @@
for(var/obj/structure/window/W in loc)
if(W)
W.throwpass=0
return .
return .
6 changes: 3 additions & 3 deletions code/modules/multiz/_HELPERS.dm
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ var/global/list/visible_spaces = list(/turf/simulated/open, /turf/simulated/floo
/proc/get_zs_away(atom/Loc1,atom/Loc2)
if(Loc1.z == Loc2.z)
return 0 // Nip this in the bud to save performance maybe
if(!AreConnectedZLevels(Loc1.z, Loc2.z))
return INFINITY // Redundant to below but sanity checking
if(!(HasAbove(Loc1.z) && HasBelow(Loc1.z)) || !(HasAbove(Loc2.z) && HasBelow(Loc2.z)) || !AreConnectedZLevels(Loc1.z, Loc2.z))
return INFINITY // Redundant to below but sanity checking and performance

var/dist_above = 0
var/dist_below = 0
Expand Down Expand Up @@ -130,4 +130,4 @@ var/global/list/visible_spaces = list(/turf/simulated/open, /turf/simulated/floo
if(HasBelow(offcenter.z) && (devastation_range >= 1 || heavy_impact_range >= 1 || light_impact_range >= 1 || flash_range >= 1))
var/turf/downcenter = GetBelow(offcenter)
if(downcenter.z < epicenter.z)
explosion_destroy(epicenter, downcenter, devastation_range, heavy_impact_range, light_impact_range, flash_range, explosion_time, whodunnit)
explosion_destroy(epicenter, downcenter, devastation_range, heavy_impact_range, light_impact_range, flash_range, explosion_time, whodunnit)