TWP: Fix audio crash when loading savegames

This commit is contained in:
scemino 2024-03-01 18:23:20 +01:00 committed by Eugene Sandulenko
parent f69d2c35e0
commit efc6ee8752
2 changed files with 2 additions and 4 deletions

View File

@ -248,7 +248,7 @@ int AudioSystem::play(Common::SharedPtr<SoundDefinition> sndDef, Audio::Mixer::S
return 0;
const Common::String &name = sndDef->getName();
Audio::SeekableAudioStream *audioStream;
Audio::SeekableAudioStream *audioStream = nullptr;
if (name.hasSuffixIgnoreCase(".ogg")) {
slot->stream.open(sndDef);
audioStream = Audio::makeVorbisStream(&slot->stream, DisposeAfterUse::NO);

View File

@ -172,9 +172,7 @@ int ResManager::newCallbackId() {
}
void ResManager::resetIds(int callbackId) {
// don't reset _roomId, _objId and _actorId because there are not dynamically created
_soundDefId = START_SOUNDDEFID;
_soundId = START_SOUNDID;
// don't reset _roomId, _objId, _soundDefId, _soundId and _actorId because there are not dynamically created
_threadId = START_THREADID;
_lightId = START_LIGHTID;
_callbackId = callbackId;