Skip to content

Commit

Permalink
TITANIC: Fixed titanic.h float random function range
Browse files Browse the repository at this point in the history
Fixed float random number function of titanic.h which could of given
65537 instead of a max of 65535.
  • Loading branch information
dafioram committed Aug 24, 2017
1 parent c96b01b commit 9b10f5d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion engines/titanic/titanic.h
Expand Up @@ -178,7 +178,7 @@ class TitanicEngine : public Engine {
/**
* Returns a uniform random floating point number in the interval [0.0, 65535.0]
*/
double getRandomFloat() { return getRandomNumber(0xfffffffe) * 0.000015259022; }
double getRandomFloat() { return getRandomNumber(0xfffffffe) * 0.00001525855623540901; } // fffffffe=4294967294 and 0.00001525855623540901 ~= 1/65537.0

/**
* Support method that generates a savegame name
Expand Down

0 comments on commit 9b10f5d

Please sign in to comment.