mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 18:22:39 +00:00
MultiZ Pulling Fixes
- Prevent pulling anchored stuff up stairs. - Prevent pulling stuff up/down z-levels thru ladders.
This commit is contained in:
@@ -812,17 +812,22 @@ default behaviour is:
|
||||
adjustBruteLoss(2)
|
||||
visible_message("<span class='danger'>\The [src]'s [isSynthetic() ? "state" : "wounds"] worsen terribly from being dragged!</span>")
|
||||
|
||||
/mob/living/Moved(var/oldloc, direct, forced, movetime)
|
||||
/mob/living/Moved(var/atom/oldloc, direct, forced, movetime)
|
||||
. = ..()
|
||||
handle_footstep(loc)
|
||||
|
||||
var/atom/movable/pullee = pulling
|
||||
if(pulling && pulling == pullee) // we were pulling a thing and didn't lose it during our move.
|
||||
if(pulling.anchored)
|
||||
if(pulling) // we were pulling a thing and didn't lose it during our move.
|
||||
if(pulling.anchored || !isturf(pulling.loc))
|
||||
stop_pulling()
|
||||
return
|
||||
|
||||
var/pull_dir = get_dir(src, pulling)
|
||||
if(get_dist(src, pulling) > 1 || (moving_diagonally != SECOND_DIAG_STEP && ((pull_dir - 1) & pull_dir))) // puller and pullee more than one tile away or in diagonal position
|
||||
// If it is too far away or across z-levels from old location, stop pulling.
|
||||
if(get_dist(pulling.loc, oldloc) > 1 || pulling.loc.z != oldloc?.z)
|
||||
stop_pulling()
|
||||
return
|
||||
|
||||
// living might take damage from drags
|
||||
if(isliving(pulling))
|
||||
var/mob/living/M = pulling
|
||||
|
||||
@@ -159,7 +159,7 @@
|
||||
A.forceMove(target)
|
||||
if(isliving(A))
|
||||
var/mob/living/L = A
|
||||
if(L.pulling)
|
||||
if(L.pulling && !L.pulling.anchored)
|
||||
L.pulling.forceMove(target)
|
||||
|
||||
/obj/structure/stairs/proc/upperStep(var/turf/T)
|
||||
|
||||
Reference in New Issue
Block a user