From 5a320c7933e276ccb82dfe8459547e7af2d0ddd1 Mon Sep 17 00:00:00 2001 From: kevinz000 <2003111+kevinz000@users.noreply.github.com> Date: Tue, 25 Feb 2020 14:37:40 -0700 Subject: [PATCH] fugg u --- code/modules/mob/living/carbon/carbon_movement.dm | 11 +++++------ code/modules/mob/living/living_movement.dm | 10 +++++++++- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/code/modules/mob/living/carbon/carbon_movement.dm b/code/modules/mob/living/carbon/carbon_movement.dm index 109473fc31..fae8ef56be 100644 --- a/code/modules/mob/living/carbon/carbon_movement.dm +++ b/code/modules/mob/living/carbon/carbon_movement.dm @@ -44,10 +44,9 @@ if(m_intent == MOVE_INTENT_RUN) nutrition -= HUNGER_FACTOR/10 -/mob/living/carbon/CanPass(atom/movable/mover, turf/target) +/mob/living/carbon/can_move_under_living(mob/living/other) . = ..() - if(.) - if(isliving(mover)) - var/mob/living/L = mover - if(!lying && L.lying) //they're down but we're not - return (L == buckled) || (L in buckled_mobs) + if(!.) //we failed earlier don't need to fail again + return + if(!other.lying && lying) //they're up, we're down. + return FALSE diff --git a/code/modules/mob/living/living_movement.dm b/code/modules/mob/living/living_movement.dm index 3e7a6fde0b..7e5fb4ec7f 100644 --- a/code/modules/mob/living/living_movement.dm +++ b/code/modules/mob/living/living_movement.dm @@ -12,10 +12,14 @@ return (!density || lying) if(buckled == mover) return TRUE + if(!ismob(mover)) + if(mover.throwing?.thrower == src) + return TRUE if(ismob(mover)) if(mover in buckled_mobs) return TRUE - return (!mover.density || !density || (mover.throwing && mover.throwing.thrower == src && !ismob(mover))) + 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))) /mob/living/toggle_move_intent() . = ..() @@ -25,6 +29,10 @@ update_move_intent_slowdown() return ..() +/// whether or not we can slide under another living mob. defaults to if we're not dense. CanPass should check "overriding circumstances" like buckled mobs/having PASSMOB flag, etc. +/mob/living/proc/can_move_under_living(mob/living/other) + return !density + /mob/living/proc/update_move_intent_slowdown() var/mod = 0 if(m_intent == MOVE_INTENT_WALK)