Fix FUSE not burning as fiercely as meant to

Broken in 49703404be.

Also fix .chance's parameter names.
This commit is contained in:
Tamás Bálint Misius
2023-09-16 21:41:07 +02:00
parent 70e6f4e241
commit ca6558bd5d
3 changed files with 5 additions and 5 deletions

View File

@@ -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()

View File

@@ -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();

View File

@@ -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;
}