From b98894b32364f1da18bc4b1ba9977f7d777bce99 Mon Sep 17 00:00:00 2001 From: Iajret Creature <122297233+AnArgonianLizardThatStealsPRs@users.noreply.github.com> Date: Thu, 16 Nov 2023 12:48:04 +0300 Subject: [PATCH] [MIRROR] [NO GBP] Fixes catwalks over open space not making a sound when walked over. [MDB IGNORE] (#664) * [NO GBP] Fixes catwalks over open space not making a sound when walked over. (#79738) --------- Co-authored-by: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Co-authored-by: Ghom <42542238+Ghommie@users.noreply.github.com> --- code/__DEFINES/dcs/signals/signals_turf.dm | 2 ++ code/datums/elements/footstep.dm | 4 ++-- code/datums/elements/footstep_override.dm | 1 + 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/code/__DEFINES/dcs/signals/signals_turf.dm b/code/__DEFINES/dcs/signals/signals_turf.dm index 65709f4e446..04a2648773a 100644 --- a/code/__DEFINES/dcs/signals/signals_turf.dm +++ b/code/__DEFINES/dcs/signals/signals_turf.dm @@ -31,5 +31,7 @@ ///from /datum/element/footstep/prepare_step(): (list/steps) #define COMSIG_TURF_PREPARE_STEP_SOUND "turf_prepare_step_sound" + //stops element/footstep/proc/prepare_step() from returning null if the turf itself has no sound + #define FOOTSTEP_OVERRIDEN (1<<0) ///from base of datum/thrownthing/finalize(): (turf/turf, atom/movable/thrownthing) when something is thrown and lands on us #define COMSIG_TURF_MOVABLE_THROW_LANDED "turf_movable_throw_landed" diff --git a/code/datums/elements/footstep.dm b/code/datums/elements/footstep.dm index 3a0a9961843..d2f129c09f4 100644 --- a/code/datums/elements/footstep.dm +++ b/code/datums/elements/footstep.dm @@ -94,9 +94,9 @@ return . = list(FOOTSTEP_MOB_SHOE = turf.footstep, FOOTSTEP_MOB_BAREFOOT = turf.barefootstep, FOOTSTEP_MOB_HEAVY = turf.heavyfootstep, FOOTSTEP_MOB_CLAW = turf.clawfootstep, STEP_SOUND_PRIORITY = STEP_SOUND_NO_PRIORITY) - SEND_SIGNAL(turf, COMSIG_TURF_PREPARE_STEP_SOUND, .) + var/overriden = SEND_SIGNAL(turf, COMSIG_TURF_PREPARE_STEP_SOUND, .) & FOOTSTEP_OVERRIDEN //The turf has no footstep sound (e.g. open space) and none of the objects on that turf (e.g. catwalks) overrides it - if(isnull(turf.footstep)) + if(!overriden && isnull(turf.footstep)) return null return . diff --git a/code/datums/elements/footstep_override.dm b/code/datums/elements/footstep_override.dm index 4e0c346c5be..43d73113280 100644 --- a/code/datums/elements/footstep_override.dm +++ b/code/datums/elements/footstep_override.dm @@ -78,3 +78,4 @@ steps[FOOTSTEP_MOB_HEAVY] = heavyfootstep steps[FOOTSTEP_MOB_CLAW] = clawfootstep steps[STEP_SOUND_PRIORITY] = priority + return FOOTSTEP_OVERRIDEN