Fixes the 'cannot push thing being pulled' bug and other weirdness.

This commit is contained in:
Neerti
2019-02-12 02:19:05 -05:00
parent 402b065247
commit c3f43aea58
2 changed files with 17 additions and 8 deletions
+4 -2
View File
@@ -223,8 +223,6 @@
/atom/movable/proc/doMove(atom/destination)
. = FALSE
if(destination)
if(pulledby)
pulledby.stop_pulling()
var/atom/oldloc = loc
var/same_loc = oldloc == destination
var/area/old_area = get_area(oldloc)
@@ -255,6 +253,10 @@
continue
AM.Crossed(src, oldloc)
// Break pulling if we are too far to pull now.
if(pulledby && (pulledby.z != src.z || get_dist(pulledby, src) > 1))
pulledby.stop_pulling()
Moved(oldloc, NONE, TRUE)
. = TRUE
+13 -6
View File
@@ -177,7 +177,9 @@ default behaviour is:
for(var/obj/structure/window/win in get_step(AM,t))
now_pushing = 0
return
step(AM, t)
if(ishuman(AM) && AM:grabbed_by)
for(var/obj/item/weapon/grab/G in AM:grabbed_by)
step(G:assailant, get_dir(G:assailant, AM))
@@ -730,7 +732,6 @@ default behaviour is:
return
/mob/living/Move(a, b, flag)
if (buckled && buckled.loc != a) //not updating position
if(istype(buckled, /mob)) //If you're buckled to a mob, a la slime things, keep on rolling.
return buckled.Move(a, b)
@@ -816,9 +817,12 @@ default behaviour is:
if(istype(location, /turf/simulated))
location.add_blood(M)
step(pulling, get_dir(pulling.loc, T))
if(t)
M.start_pulling(t)
if(get_dist(pulling.loc, T) > 1 || pulling.loc.z != T.z)
M.stop_pulling()
else
step(pulling, get_dir(pulling.loc, T))
if(t)
M.start_pulling(t)
else
if (pulling)
if (istype(pulling, /obj/structure/window))
@@ -826,8 +830,11 @@ default behaviour is:
if(W.is_fulltile())
for(var/obj/structure/window/win in get_step(pulling,get_dir(pulling.loc, T)))
stop_pulling()
if (pulling)
step(pulling, get_dir(pulling.loc, T))
if(get_dist(pulling.loc, T) > 1 || pulling.loc.z != T.z) // This is needed or else pulled objects can't get pushed away.
stop_pulling()
else
step(pulling, get_dir(pulling.loc, T))
else
stop_pulling()
. = ..()