1
0
Fork 1
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:
Chris Robinson 2012-03-22 18:39:10 -07:00
parent bac6df5563
commit 2e28819243

View file

@ -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