diff --git a/src/common/tpt-rand.cpp b/src/common/tpt-rand.cpp index 84af99189..cb5155d89 100644 --- a/src/common/tpt-rand.cpp +++ b/src/common/tpt-rand.cpp @@ -38,11 +38,11 @@ int RNG::between(int lower, int upper) return static_cast(r % ((unsigned int)(upper) - (unsigned int)(lower) + 1U)) + lower; } -bool RNG::chance(int nominator, unsigned int denominator) +bool RNG::chance(int numerator, unsigned int denominator) { - if (nominator < 0) + if (numerator < 0) return false; - return next() % denominator < static_cast(nominator); + return next() % denominator < static_cast(numerator); } float RNG::uniform01() diff --git a/src/common/tpt-rand.h b/src/common/tpt-rand.h index 9eb4ed29a..e71430a6c 100644 --- a/src/common/tpt-rand.h +++ b/src/common/tpt-rand.h @@ -15,7 +15,7 @@ public: unsigned int operator()(); unsigned int gen(); int between(int lower, int upper); - bool chance(int nominator, unsigned int denominator); + bool chance(int numerator, unsigned int denominator); float uniform01(); RNG(); diff --git a/src/simulation/elements/FUSE.cpp b/src/simulation/elements/FUSE.cpp index 0c3a61ca1..51ac430de 100644 --- a/src/simulation/elements/FUSE.cpp +++ b/src/simulation/elements/FUSE.cpp @@ -59,7 +59,7 @@ static int update(UPDATE_FUNC_ARGS) else if (parts[i].life < 40) { parts[i].life--; if (sim->rng.chance(1, 100)) { - auto r = sim->create_part(-1, x + sim->rng.chance(-1, 1), y + sim->rng.chance(-1, 1), PT_PLSM); + auto r = sim->create_part(-1, x + sim->rng.between(-1, 1), y + sim->rng.between(-1, 1), PT_PLSM); if (r>-1) parts[r].life = 50; }