1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-24 07:14:31 +01:00

Fix #17297: Crash when switching language (#17370)

* Refactor all uses of IAudioChannel and the audio mixer.
* Use shared_ptr to avoid dead pointers hanging about.
* Reload particular audio channels where necessary after object reload.
This commit is contained in:
Ted John
2022-06-27 17:41:53 +01:00
committed by GitHub
parent 0d6a8af643
commit 585ebed600
32 changed files with 257 additions and 395 deletions

View File

@@ -24,6 +24,7 @@
#include <algorithm>
using namespace OpenRCT2;
using namespace OpenRCT2::Audio;
bool gChatOpen = false;
static char _chatCurrentLine[CHAT_MAX_MESSAGE_LENGTH];
@@ -230,7 +231,7 @@ void chat_history_add(std::string_view s)
// Log to file (src only as logging does its own timestamp)
network_append_chat_log(s);
Mixer_Play_Effect(OpenRCT2::Audio::SoundId::NewsItem, 0, MIXER_VOLUME_MAX, 0.5f, 1.5f, true);
CreateAudioChannel(SoundId::NewsItem, 0, MIXER_VOLUME_MAX, 0.5f, 1.5f, true);
}
void chat_input(ChatInput input)