mirror of
https://github.com/The-Powder-Toy/The-Powder-Toy.git
synced 2025-08-30 11:19:51 +02:00
Fix FUSE not burning as fiercely as meant to
Broken in 49703404be
.
Also fix .chance's parameter names.
This commit is contained in:
@@ -38,11 +38,11 @@ int RNG::between(int lower, int upper)
|
||||
return static_cast<int>(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<unsigned int>(nominator);
|
||||
return next() % denominator < static_cast<unsigned int>(numerator);
|
||||
}
|
||||
|
||||
float RNG::uniform01()
|
||||
|
@@ -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();
|
||||
|
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user