1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-21 05:53:02 +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

@@ -11,6 +11,7 @@
#include "../Context.h"
#include "../ParkImporter.h"
#include "../audio/audio.h"
#include "../core/Console.hpp"
#include "../core/Memory.hpp"
#include "../localisation/StringIds.h"
@@ -238,6 +239,10 @@ public:
}
UpdateSceneryGroupIndexes();
ResetTypeToRideEntryIndexMap();
// We will need to replay the title music if the title music object got reloaded
OpenRCT2::Audio::StopTitleMusic();
OpenRCT2::Audio::PlayTitleMusic();
}
std::vector<const ObjectRepositoryItem*> GetPackableObjects() override