- Fixed: The DECORATE expression evaluator's random function could produce

incorrect results for ranges > 255. Changed so that FRandom's default
  implementation is used instead.


SVN r769 (trunk)
This commit is contained in:
Christoph Oelckers 2008-02-25 15:43:22 +00:00
parent 88068f74c5
commit 24100c25a9
2 changed files with 6 additions and 17 deletions

View file

@ -1,3 +1,8 @@
February 25, 2008 (Changes by Graf Zahl)
- Fixed: The DECORATE expression evaluator's random function could produce
incorrect results for ranges > 255. Changed so that FRandom's default
implementation is used instead.
February 21, 2008 February 21, 2008
- Fixed: DThinker::SerializeAll() did not serialize any thinkers in the - Fixed: DThinker::SerializeAll() did not serialize any thinkers in the
FreshThinkers lists. These thinkers would still be saved in the savegame if FreshThinkers lists. These thinkers would still be saved in the savegame if

View file

@ -1477,23 +1477,7 @@ static ExpVal EvalExpression (ExpData *data, AActor *self, const PClass *cls)
swap (max, min); swap (max, min);
} }
if (max - min > 255) val.Int = (*data->RNG)(max - min + 1) + min;
{
int num1,num2,num3,num4;
num1 = (*data->RNG)();
num2 = (*data->RNG)();
num3 = (*data->RNG)();
num4 = (*data->RNG)();
val.Int = ((num1 << 24) | (num2 << 16) | (num3 << 8) | num4);
}
else
{
val.Int = (*data->RNG)();
}
val.Int %= (max - min + 1);
val.Int += min;
} }
break; break;