Switched LURE to use a single central RandomSource instance, instead of (sometimes) creating a new RandomSource every function call.

svn-id: r43715
This commit is contained in:
Johannes Schickel 2009-08-24 23:04:25 +00:00
parent e98c791106
commit ac5a6552ca
10 changed files with 20 additions and 27 deletions

View file

@ -739,9 +739,7 @@ void Script::addActions(uint16 hotspotId, uint16 actions, uint16 v3) {
// Generates a random number and stores it in the general field
void Script::randomToGeneral(uint16 maxVal, uint16 minVal, uint16 v3) {
Common::RandomSource rnd;
g_eventRec.registerRandomSource(rnd, "lureScripts");
uint16 v = minVal + rnd.getRandomNumber(maxVal - minVal);
uint16 v = minVal + LureEngine::getReference().rnd().getRandomNumber(maxVal - minVal);
Resources::getReference().fieldList().setField(GENERAL, v);
}