mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-02-21 22:09:39 +00:00
Avoid trying to play an ambient sound if there's no chance for any to play
This commit is contained in:
parent
bac6df5563
commit
2e28819243
1 changed files with 2 additions and 3 deletions
|
@ -341,9 +341,6 @@ namespace MWSound
|
||||||
}
|
}
|
||||||
|
|
||||||
const ESM::Region *regn = mEnvironment.mWorld->getStore().regions.find(regionName);
|
const ESM::Region *regn = mEnvironment.mWorld->getStore().regions.find(regionName);
|
||||||
if(regn->soundList.size() == 0)
|
|
||||||
return;
|
|
||||||
|
|
||||||
std::vector<ESM::Region::SoundRef>::const_iterator soundIter;
|
std::vector<ESM::Region::SoundRef>::const_iterator soundIter;
|
||||||
if(total == 0)
|
if(total == 0)
|
||||||
{
|
{
|
||||||
|
@ -353,6 +350,8 @@ namespace MWSound
|
||||||
total += (int)soundIter->chance;
|
total += (int)soundIter->chance;
|
||||||
soundIter++;
|
soundIter++;
|
||||||
}
|
}
|
||||||
|
if(total == 0)
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
int r = rand() % total; //old random code
|
int r = rand() % total; //old random code
|
||||||
|
|
Loading…
Reference in a new issue