From 80322feeb58282e98a5a64be57219f3be296aab5 Mon Sep 17 00:00:00 2001 From: MINIMAN10000 Date: Tue, 29 Jan 2019 21:09:53 -0800 Subject: [PATCH] mobs on helpful intent no longer push pulled structures or players pulling structures, structure.dm follows mob.dm's issilicon for isstructure as per contributing no hacky code, pulledby now set to null when stop_pulling() is called, thus they actually stop pulling --- code/game/atoms_movable.dm | 1 + code/game/objects/structures.dm | 1 + code/modules/mob/living/living.dm | 11 +++++++++++ 3 files changed, 13 insertions(+) diff --git a/code/game/atoms_movable.dm b/code/game/atoms_movable.dm index b1afabf9737..2d3f01a139d 100644 --- a/code/game/atoms_movable.dm +++ b/code/game/atoms_movable.dm @@ -93,6 +93,7 @@ pulling.pulledby = null var/mob/living/ex_pulled = pulling pulling = null + pulledby = null if(isliving(ex_pulled)) var/mob/living/L = ex_pulled L.update_canmove()// mob gets up if it was lyng down in a chokehold diff --git a/code/game/objects/structures.dm b/code/game/objects/structures.dm index faf86394dba..2343dbb923b 100644 --- a/code/game/objects/structures.dm +++ b/code/game/objects/structures.dm @@ -4,6 +4,7 @@ var/climbable var/mob/climber var/broken = FALSE + #define isstructure(A) (istype((A), /obj/structure)) /obj/structure/blob_act() if(prob(50)) diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index cfb16c0f04a..0ea7a479877 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -80,6 +80,10 @@ if(moving_diagonally) //no mob swap during diagonal moves. return 1 + if(a_intent == INTENT_HELP) // Help intent doesn't mob swap a mob pulling a structure + if(isstructure(M.pulling) || isstructure(pulling)) + return 1 + if(!M.buckled && !M.has_buckled_mobs()) var/mob_swap //the puller can always swap with it's victim if on grab intent @@ -128,6 +132,13 @@ //Called when we want to push an atom/movable /mob/living/proc/PushAM(atom/movable/AM, force = move_force) + + if(isstructure(AM) && AM.pulledby) + if(a_intent == INTENT_HELP && AM.pulledby != src) // Help intent doesn't push other peoples pulled structures + return FALSE + if(get_dist(get_step(AM, get_dir(src, AM)), AM.pulledby)>1)//Release pulled structures beyond 1 distance + AM.pulledby.stop_pulling() + if(now_pushing) return TRUE if(moving_diagonally) // no pushing during diagonal moves