mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-03-16 16:20:53 +00:00
Merge pull request #2440 from jlaumon/sound_crash_fix
Fixed crash with sound disabled (bug #4600)
This commit is contained in:
commit
240f76e822
@ -23,6 +23,7 @@
|
||||
Bug #4384: Resist Normal Weapons only checks ammunition for ranged weapons
|
||||
Bug #4411: Reloading a saved game while falling prevents damage in some cases
|
||||
Bug #4540: Rain delay when exiting water
|
||||
Bug #4600: Crash when no sound output is available or --no-sound is used.
|
||||
Bug #4639: Black screen after completing first mages guild mission + training
|
||||
Bug #4701: PrisonMarker record is not hardcoded like other markers
|
||||
Bug #4703: Editor: it's possible to preview levelled list records
|
||||
|
@ -983,7 +983,6 @@ void CharacterController::handleTextKey(const std::string &groupname, const std:
|
||||
if(evt.compare(0, 7, "sound: ") == 0)
|
||||
{
|
||||
MWBase::SoundManager *sndMgr = MWBase::Environment::get().getSoundManager();
|
||||
sndMgr->stopSound3D(mPtr, evt.substr(7));
|
||||
sndMgr->playSound3D(mPtr, evt.substr(7), 1.0f, 1.0f);
|
||||
return;
|
||||
}
|
||||
@ -1024,7 +1023,6 @@ void CharacterController::handleTextKey(const std::string &groupname, const std:
|
||||
}
|
||||
else
|
||||
{
|
||||
sndMgr->stopSound3D(mPtr, sound);
|
||||
sndMgr->playSound3D(mPtr, sound, volume, pitch);
|
||||
}
|
||||
}
|
||||
|
@ -747,6 +747,9 @@ namespace MWSound
|
||||
|
||||
void SoundManager::stopSound(const std::string& soundId)
|
||||
{
|
||||
if(!mOutput->isInitialized())
|
||||
return;
|
||||
|
||||
Sound_Buffer *sfx = loadSound(Misc::StringUtils::lowerCase(soundId));
|
||||
if (!sfx) return;
|
||||
|
||||
@ -755,6 +758,9 @@ namespace MWSound
|
||||
|
||||
void SoundManager::stopSound3D(const MWWorld::ConstPtr &ptr, const std::string& soundId)
|
||||
{
|
||||
if(!mOutput->isInitialized())
|
||||
return;
|
||||
|
||||
Sound_Buffer *sfx = loadSound(Misc::StringUtils::lowerCase(soundId));
|
||||
if (!sfx) return;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user