mirror of
https://github.com/OpenMW/openmw.git
synced 2025-06-23 08:11:37 +00:00
Fix crash when rollDice is called with 0.
This commit is contained in:
parent
1f1f47431f
commit
48fb6bb9e8
1 changed files with 1 additions and 1 deletions
|
@ -25,7 +25,7 @@ namespace Misc
|
||||||
|
|
||||||
int Rng::rollDice(int max)
|
int Rng::rollDice(int max)
|
||||||
{
|
{
|
||||||
return std::uniform_int_distribution<int>(0, max - 1)(generator);
|
return max > 0 ? std::uniform_int_distribution<int>(0, max - 1)(generator) : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue