mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-20 07:23:51 +00:00
Cast Random result to float (bug #5175)
This commit is contained in:
parent
4efdc88f1a
commit
bde4a38181
3 changed files with 3 additions and 4 deletions
|
@ -153,6 +153,7 @@
|
||||||
Bug #5167: Player can select and cast spells before magic menu is enabled
|
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 #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 #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 #1774: Handle AvoidNode
|
||||||
Feature #2229: Improve pathfinding AI
|
Feature #2229: Improve pathfinding AI
|
||||||
Feature #3025: Analogue gamepad movement controls
|
Feature #3025: Analogue gamepad movement controls
|
||||||
|
|
|
@ -489,7 +489,7 @@ namespace Compiler
|
||||||
parseArguments ("l", scanner);
|
parseArguments ("l", scanner);
|
||||||
|
|
||||||
Generator::random (mCode);
|
Generator::random (mCode);
|
||||||
mOperands.push_back ('l');
|
mOperands.push_back ('f');
|
||||||
|
|
||||||
mNextOperand = false;
|
mNextOperand = false;
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -190,9 +190,7 @@ namespace Interpreter
|
||||||
throw std::runtime_error (
|
throw std::runtime_error (
|
||||||
"random: argument out of range (Don't be so negative!)");
|
"random: argument out of range (Don't be so negative!)");
|
||||||
|
|
||||||
Type_Integer value = Misc::Rng::rollDice(limit); // [o, limit)
|
runtime[0].mFloat = static_cast<Type_Float>(Misc::Rng::rollDice(limit)); // [o, limit)
|
||||||
|
|
||||||
runtime[0].mInteger = value;
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue