From e37402a3550fb6ec84c156b0d987e576e1970c67 Mon Sep 17 00:00:00 2001 From: jc_gargma Date: Sun, 20 Feb 2022 21:36:11 -0800 Subject: Fix smash_fail calling null variant. --- sound-01_fix-broken-smash-fail.patch | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 sound-01_fix-broken-smash-fail.patch (limited to 'sound-01_fix-broken-smash-fail.patch') diff --git a/sound-01_fix-broken-smash-fail.patch b/sound-01_fix-broken-smash-fail.patch new file mode 100644 index 0000000..38a5427 --- /dev/null +++ b/sound-01_fix-broken-smash-fail.patch @@ -0,0 +1,28 @@ +--- a/src/map.cpp ++++ b/src/map.cpp +@@ -3329,7 +3329,6 @@ + bash_results map::bash_ter_furn( const tripoint &p, const bash_params ¶ms ) + { + bash_results result; +- std::string soundfxvariant; + const auto &ter_obj = ter( p ).obj(); + const auto &furn_obj = furn( p ).obj(); + bool smash_ter = false; +@@ -3432,8 +3431,15 @@ + + result.did_bash = true; + if( !params.silent ) { +- sounds::sound( p, sound_volume, sounds::sound_t::combat, bash->sound_fail, false, +- "smash_fail", soundfxvariant ); ++ if( smash_ter == true ) { ++ std::string soundfxvariant = ter_obj.id.str(); ++ sounds::sound( p, sound_volume, sounds::sound_t::combat, bash->sound_fail, false, ++ "smash_fail", soundfxvariant ); ++ } else { ++ std::string soundfxvariant = furn_obj.id.str(); ++ sounds::sound( p, sound_volume, sounds::sound_t::combat, bash->sound_fail, false, ++ "smash_fail", soundfxvariant ); ++ } + } + } else { + if( smash_ter ) { -- cgit v1.2.1