mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-05-10 04:26:50 +03:00
Use a better method to get a more even randomization
This commit is contained in:
parent
2bc81a778b
commit
3e98e28059
1 changed files with 1 additions and 1 deletions
|
@ -350,7 +350,7 @@ namespace MWSound
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
int r = rand() % total; //old random code
|
int r = (int)(rand()/((double)RAND_MAX+1) * total);
|
||||||
int pos = 0;
|
int pos = 0;
|
||||||
|
|
||||||
soundIter = regn->soundList.begin();
|
soundIter = regn->soundList.begin();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue