mirror of
https://github.com/TES3MP/TES3MP.git
synced 2025-09-26 14:36:40 -04:00
Fix crash when rollDice is called with 0.
This commit is contained in:
parent
1f1f47431f
commit
48fb6bb9e8
@ -25,7 +25,7 @@ namespace Misc
|
||||
|
||||
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…
x
Reference in New Issue
Block a user