diff --git a/components/misc/rng.cpp b/components/misc/rng.cpp index dfe0eff40..e402f0b79 100644 --- a/components/misc/rng.cpp +++ b/components/misc/rng.cpp @@ -25,7 +25,7 @@ namespace Misc int Rng::rollDice(int max) { - return std::uniform_int_distribution(0, max - 1)(generator); + return max > 0 ? std::uniform_int_distribution(0, max - 1)(generator) : 0; } }