mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-25 06:35:30 +00:00
Merge pull request #2546 from Capostrophic/random
Cast Random result to float (bug #5175)
This commit is contained in:
commit
9a27714766
@ -153,6 +153,7 @@
|
||||
Bug #5167: Player can select and cast spells before magic menu is enabled
|
||||
Bug #5168: Force1stPerson and Force3rdPerson commands are not really force view change
|
||||
Bug #5169: Nested levelled items/creatures have significantly higher chance not to spawn
|
||||
Bug #5175: Random script function returns an integer value
|
||||
Feature #1774: Handle AvoidNode
|
||||
Feature #2229: Improve pathfinding AI
|
||||
Feature #3025: Analogue gamepad movement controls
|
||||
|
@ -489,7 +489,7 @@ namespace Compiler
|
||||
parseArguments ("l", scanner);
|
||||
|
||||
Generator::random (mCode);
|
||||
mOperands.push_back ('l');
|
||||
mOperands.push_back ('f');
|
||||
|
||||
mNextOperand = false;
|
||||
return true;
|
||||
|
@ -190,9 +190,7 @@ namespace Interpreter
|
||||
throw std::runtime_error (
|
||||
"random: argument out of range (Don't be so negative!)");
|
||||
|
||||
Type_Integer value = Misc::Rng::rollDice(limit); // [o, limit)
|
||||
|
||||
runtime[0].mInteger = value;
|
||||
runtime[0].mFloat = static_cast<Type_Float>(Misc::Rng::rollDice(limit)); // [o, limit)
|
||||
}
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user