diff --git a/code/game/atoms_movement.dm b/code/game/atoms_movement.dm index f862b87b7a..d418652cd8 100644 --- a/code/game/atoms_movement.dm +++ b/code/game/atoms_movement.dm @@ -120,30 +120,31 @@ return if(!loc || (loc == oldloc && oldloc != newloc)) - last_move = 0 + last_move = NONE return if(.) + last_move = direct + setDir(direct) + + if(has_buckled_mobs() && !handle_buckled_mob_movement(loc,direct)) //movement failed due to buckled mob(s) + return FALSE + + if(pulling && pulling == pullee) //we were pulling a thing and didn't lose it during our move. + if(pulling.anchored) + stop_pulling() + else + var/pull_dir = get_dir(src, pulling) + //puller and pullee more than one tile away or in diagonal position + if(get_dist(src, pulling) > 1 || (moving_diagonally != SECOND_DIAG_STEP && ((pull_dir - 1) & pull_dir))) + pulling.Move(T, get_dir(pulling, T)) //the pullee tries to reach our previous position + if(pulling && get_dist(src, pulling) > 1) //the pullee couldn't keep up + stop_pulling() + if(pulledby && moving_diagonally != FIRST_DIAG_STEP && get_dist(src, pulledby) > 1)//separated from our puller and not in the middle of a diagonal move. + pulledby.stop_pulling() + Moved(oldloc, direct) - if(. && pulling && pulling == pullee) //we were pulling a thing and didn't lose it during our move. - if(pulling.anchored) - stop_pulling() - else - var/pull_dir = get_dir(src, pulling) - //puller and pullee more than one tile away or in diagonal position - if(get_dist(src, pulling) > 1 || (moving_diagonally != SECOND_DIAG_STEP && ((pull_dir - 1) & pull_dir))) - pulling.Move(T, get_dir(pulling, T)) //the pullee tries to reach our previous position - if(pulling && get_dist(src, pulling) > 1) //the pullee couldn't keep up - stop_pulling() - if(pulledby && moving_diagonally != FIRST_DIAG_STEP && get_dist(src, pulledby) > 1)//separated from our puller and not in the middle of a diagonal move. - pulledby.stop_pulling() - - last_move = direct - setDir(direct) - if(. && has_buckled_mobs() && !handle_buckled_mob_movement(loc,direct)) //movement failed due to buckled mob(s) - return FALSE - /atom/movable/proc/handle_buckled_mob_movement(newloc,direct) for(var/m in buckled_mobs) var/mob/living/buckled_mob = m diff --git a/code/modules/mob/living/living_movement.dm b/code/modules/mob/living/living_movement.dm index c5f48880ba..c713c80a7b 100644 --- a/code/modules/mob/living/living_movement.dm +++ b/code/modules/mob/living/living_movement.dm @@ -19,7 +19,7 @@ if(mover in buckled_mobs) return TRUE var/mob/living/L = mover //typecast first, check isliving and only check this if living using short circuit - return (!density || (isliving(mover) && !mover.density && L.can_move_under_living(src))) + return (!density || (!mover.density && (!isliving(mover) || L.can_move_under_living(src)))) /mob/living/toggle_move_intent() . = ..() diff --git a/tgstation.dme b/tgstation.dme index 69eac2b236..27668a7074 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -573,6 +573,7 @@ #include "code\game\alternate_appearance.dm" #include "code\game\atoms.dm" #include "code\game\atoms_movable.dm" +#include "code\game\atoms_movement.dm" #include "code\game\communications.dm" #include "code\game\data_huds.dm" #include "code\game\say.dm"