Skip to content

Commit

Permalink
[MIRROR] [NO GBP] Fixes catwalks over open space not making a sound w…
Browse files Browse the repository at this point in the history
…hen walked over. [MDB IGNORE] (#664)

* [NO GBP] Fixes catwalks over open space not making a sound when walked over. (#79738)

---------

Co-authored-by: SkyratBot <[email protected]>
Co-authored-by: Ghom <[email protected]>
  • Loading branch information
3 people authored Nov 16, 2023
1 parent d55960d commit b98894b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 2 additions & 0 deletions code/__DEFINES/dcs/signals/signals_turf.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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"
4 changes: 2 additions & 2 deletions code/datums/elements/footstep.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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 .

Expand Down
1 change: 1 addition & 0 deletions code/datums/elements/footstep_override.dm
Original file line number Diff line number Diff line change
Expand Up @@ -78,3 +78,4 @@
steps[FOOTSTEP_MOB_HEAVY] = heavyfootstep
steps[FOOTSTEP_MOB_CLAW] = clawfootstep
steps[STEP_SOUND_PRIORITY] = priority
return FOOTSTEP_OVERRIDEN

0 comments on commit b98894b

Please sign in to comment.