Fix crash when rollDice is called with 0.

0.6.3
Evgeny Kurnevsky 7 years ago
parent 1f1f47431f
commit 48fb6bb9e8
No known key found for this signature in database
GPG Key ID: 8FF444E5412D750C

@ -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…
Cancel
Save