mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-19 12:21:34 +00:00
Merge pull request #960 from noudess/patch-6
Further refine monk weight checks for floating point
This commit is contained in:
commit
6dee837f67
@ -726,18 +726,18 @@ int Mob::GetClassRaceACBonus()
|
|||||||
}
|
}
|
||||||
int weight = IsClient() ? CastToClient()->CalcCurrentWeight()/10 : 0;
|
int weight = IsClient() ? CastToClient()->CalcCurrentWeight()/10 : 0;
|
||||||
if (weight < hardcap - 1) {
|
if (weight < hardcap - 1) {
|
||||||
int temp = level + 5;
|
double temp = level + 5;
|
||||||
if (weight > softcap) {
|
if (weight > softcap) {
|
||||||
double redux = (weight - softcap) * 6.66667;
|
double redux = static_cast<double>(weight - softcap) * 6.66667;
|
||||||
redux = (100.0 - std::min(100.0, redux)) * 0.01;
|
redux = (100.0 - std::min(100.0, redux)) * 0.01;
|
||||||
temp = std::max(0, static_cast<int>(temp * redux));
|
temp = std::max(0.0, temp * redux);
|
||||||
}
|
}
|
||||||
ac_bonus = (4 * temp) / 3;
|
ac_bonus = static_cast<int>((4.0 * temp) / 3.0);
|
||||||
}
|
}
|
||||||
else if (weight > hardcap + 1) {
|
else if (weight > hardcap + 1) {
|
||||||
int temp = level + 5;
|
double temp = level + 5;
|
||||||
double multiplier = std::min(1.0, (weight - (hardcap - 10.0)) / 100.0);
|
double multiplier = std::min(1.0, (weight - (static_cast<double>(hardcap) - 10.0)) / 100.0);
|
||||||
temp = (4 * temp) / 3;
|
temp = (4.0 * temp) / 3.0;
|
||||||
ac_bonus -= static_cast<int>(temp * multiplier);
|
ac_bonus -= static_cast<int>(temp * multiplier);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user