Skip to content

Commit

Permalink
...AmountCalculator: Remove integer truncation random compensations
Browse files Browse the repository at this point in the history
Let's just round down instead of involving RNG.
  • Loading branch information
bm01 committed Jul 27, 2024
1 parent 835f77e commit b549fb5
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,6 @@ Players will no longer need to sit to regenerate faster.
else
regen *= ServerProperties.Properties.ENDURANCE_REGEN_AMOUNT_MODIFIER;

double decimals = regen - (int) regen;

// Compensate for int rounding.
if (Util.ChanceDouble(decimals))
regen += 1;

return (int) regen;
}
}
Expand Down
7 changes: 0 additions & 7 deletions GameServer/propertycalc/HealthRegenerationAmountCalculator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,6 @@ public override int CalcValue(GameLiving living, eProperty property)
}

regen *= ServerProperties.Properties.HEALTH_REGEN_AMOUNT_MODIFIER;

double decimals = regen - (int) regen;

// Compensate for int rounding.
if (Util.ChanceDouble(decimals))
regen += 1;

regen += living.ItemBonus[(int)property];

int debuff = living.SpecBuffBonusCategory[(int) property];
Expand Down
7 changes: 0 additions & 7 deletions GameServer/propertycalc/PowerRegenerationAmountCalculator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,6 @@ public override int CalcValue(GameLiving living, eProperty property)
regen /= 2.0;

regen *= ServerProperties.Properties.MANA_REGEN_AMOUNT_MODIFIER;

double decimals = regen - (int) regen;

// Compensate for int rounding.
if (Util.ChanceDouble(decimals))
regen += 1;

int debuff = living.SpecBuffBonusCategory[(int) property];

if (debuff < 0)
Expand Down

0 comments on commit b549fb5

Please sign in to comment.