Fixed overflow on AC and ATK values that can go out of range.

This commit is contained in:
SecretsOTheP
2014-11-03 19:14:58 -05:00
parent 29079a7ec2
commit 8efc652c10
4 changed files with 9 additions and 8 deletions
+2 -2
View File
@@ -665,7 +665,7 @@ void Mob::MeleeMitigation(Mob *attacker, int32 &damage, int32 minhit, ExtraAttac
////////////////////////////////////////////////////////
// Scorpious2k: Include AC in the calculation
// use serverop variables to set values
int myac = GetAC();
int32 myac = GetAC();
if(opts) {
myac *= (1.0f - opts->armor_pen_percent);
myac -= opts->armor_pen_flat;
@@ -696,7 +696,7 @@ void Mob::MeleeMitigation(Mob *attacker, int32 &damage, int32 minhit, ExtraAttac
}
if (acreduction>0) {
damage -= (int) (GetAC() * acreduction/100.0f);
damage -= (int32) (GetAC() * acreduction/100.0f);
}
if (acrandom>0) {
damage -= (myac * MakeRandomInt(0, acrandom) / 10000);