summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Lioncash2020-10-17 09:46:11 -0400
committerGravatar Lioncash2020-10-17 09:50:04 -0400
commitc1577f3448d3d9a691efc252edbf46c7b6756cb5 (patch)
tree42fca9f8a3c14a346ce5a04fad066d88f6c3abd3
parentMerge pull request #4790 from lioncash/input-common (diff)
downloadyuzu-c1577f3448d3d9a691efc252edbf46c7b6756cb5.tar.gz
yuzu-c1577f3448d3d9a691efc252edbf46c7b6756cb5.tar.xz
yuzu-c1577f3448d3d9a691efc252edbf46c7b6756cb5.zip
mii/manager: Make use of unused lower bound in GetRandomValue()
Previously, the lower bound wasn't being used and zero was being used as the lower bound every time this function was called. This affects the outcome of some of the randomized entries a little bit, for example, the lower-bound for beard and mustache flags was supposed to be 1, not 0. Aside from these cases, the bug didn't affect anything else.
-rw-r--r--src/core/hle/service/mii/manager.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/core/hle/service/mii/manager.cpp b/src/core/hle/service/mii/manager.cpp
index 8e433eb41..d73b90015 100644
--- a/src/core/hle/service/mii/manager.cpp
+++ b/src/core/hle/service/mii/manager.cpp
@@ -131,7 +131,7 @@ template <typename T>
131T GetRandomValue(T min, T max) { 131T GetRandomValue(T min, T max) {
132 std::random_device device; 132 std::random_device device;
133 std::mt19937 gen(device()); 133 std::mt19937 gen(device());
134 std::uniform_int_distribution<u64> distribution(0, static_cast<u64>(max)); 134 std::uniform_int_distribution<u64> distribution(static_cast<u64>(min), static_cast<u64>(max));
135 return static_cast<T>(distribution(gen)); 135 return static_cast<T>(distribution(gen));
136} 136}
137 137