Browse Source

access: log warning when low HP sound fails to load

Add a LogWarn call when none of the expected audio file paths for the
low HP warning sound can be loaded, making it easier to diagnose missing
or misplaced sound assets.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
pull/8474/head
hidwood 2 months ago
parent
commit
91e4ab4e09
  1. 2
      Source/utils/accessibility_announcements.cpp

2
Source/utils/accessibility_announcements.cpp

@ -33,6 +33,7 @@
#include "player.h" #include "player.h"
#include "utils/is_of.hpp" #include "utils/is_of.hpp"
#include "utils/language.h" #include "utils/language.h"
#include "utils/log.hpp"
#include "utils/screen_reader.hpp" #include "utils/screen_reader.hpp"
#include "utils/str_cat.hpp" #include "utils/str_cat.hpp"
#include "utils/string_or_view.hpp" #include "utils/string_or_view.hpp"
@ -74,6 +75,7 @@ TSnd *GetPlayerLowHpWarningSound()
&& PlayerLowHpWarningSound->DSB.SetChunkStream("..\\audio\\playerhaslowhp.wav", /*isMp3=*/false, /*logErrors=*/false) != 0 && PlayerLowHpWarningSound->DSB.SetChunkStream("..\\audio\\playerhaslowhp.wav", /*isMp3=*/false, /*logErrors=*/false) != 0
&& PlayerLowHpWarningSound->DSB.SetChunkStream("audio\\player_has_low_hp.wav", /*isMp3=*/false, /*logErrors=*/false) != 0 && PlayerLowHpWarningSound->DSB.SetChunkStream("audio\\player_has_low_hp.wav", /*isMp3=*/false, /*logErrors=*/false) != 0
&& PlayerLowHpWarningSound->DSB.SetChunkStream("..\\audio\\player_has_low_hp.wav", /*isMp3=*/false, /*logErrors=*/false) != 0) { && PlayerLowHpWarningSound->DSB.SetChunkStream("..\\audio\\player_has_low_hp.wav", /*isMp3=*/false, /*logErrors=*/false) != 0) {
LogWarn("Failed to load low HP warning sound from any of the expected paths.");
PlayerLowHpWarningSound = nullptr; PlayerLowHpWarningSound = nullptr;
} }

Loading…
Cancel
Save