This commit is contained in:
kevinz000
2020-02-25 14:37:40 -07:00
parent 40c2bdf5ee
commit 5a320c7933
2 changed files with 14 additions and 7 deletions
@@ -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
+9 -1
View File
@@ -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)