From 89dd3c38921c853d9505ccd7253990754c81cf6b Mon Sep 17 00:00:00 2001 From: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Date: Sun, 4 Sep 2022 04:47:03 +0200 Subject: [PATCH] [MIRROR] Fix slimepeople soft landing showing message for stairs and self [MDB IGNORE] (#15959) * Fix slimepeople soft landing showing message for stairs and self (#69263) * Fix soft landing showing messages for self and stairs * Fix syntax error * Fix missing return syntax * Move turf check out of loop * Fix slimepeople soft landing showing message for stairs and self Co-authored-by: Tim --- code/datums/elements/soft_landing.dm | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/code/datums/elements/soft_landing.dm b/code/datums/elements/soft_landing.dm index b57337fd643..8e445a7c871 100644 --- a/code/datums/elements/soft_landing.dm +++ b/code/datums/elements/soft_landing.dm @@ -17,9 +17,17 @@ UnregisterSignal(target, COMSIG_ATOM_INTERCEPT_Z_FALL) ///signal called by the stat of the target changing -/datum/element/soft_landing/proc/intercept_z_fall(obj/soft_object, falling_movables, levels) +/datum/element/soft_landing/proc/intercept_z_fall(atom/soft_object, falling_movables, levels) SIGNAL_HANDLER - for (var/mob/living/falling_victim in falling_movables) - to_chat(falling_victim, span_notice("[soft_object] provides a soft landing for you!")) + var/turf/falling_spot = get_turf(soft_object) + + if(locate(/obj/structure/stairs) in falling_spot) + return FALL_INTERCEPTED | FALL_NO_MESSAGE + + for(var/mob/living/falling_victim in falling_movables) + if(soft_object == falling_victim) + to_chat(falling_victim, span_notice("Your fall is cushioned by your body to provide a soft landing!")) + else + to_chat(falling_victim, span_notice("[soft_object] provides a soft landing for you!")) return FALL_INTERCEPTED | FALL_NO_MESSAGE