mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-25 15:35:23 +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
@ -341,9 +341,6 @@ namespace MWSound
|
||||
}
|
||||
|
||||
const ESM::Region *regn = mEnvironment.mWorld->getStore().regions.find(regionName);
|
||||
if(regn->soundList.size() == 0)
|
||||
return;
|
||||
|
||||
std::vector<ESM::Region::SoundRef>::const_iterator soundIter;
|
||||
if(total == 0)
|
||||
{
|
||||
@ -353,6 +350,8 @@ namespace MWSound
|
||||
total += (int)soundIter->chance;
|
||||
soundIter++;
|
||||
}
|
||||
if(total == 0)
|
||||
return;
|
||||
}
|
||||
|
||||
int r = rand() % total; //old random code
|
||||
|
Loading…
x
Reference in New Issue
Block a user