Merge pull request #149 from nossr50/master

Possible fix for negative XP bug.
This commit is contained in:
Grant 2012-02-10 16:32:24 -08:00
commit fe9db6c9ad

View File

@ -83,8 +83,6 @@ public class Combat
Unarmed.disarmProcCheck(attacker, defender);
}
//Modify the event damage if Attacker is Berserk
if(PPa.getBerserkMode())
event.setDamage(event.getDamage() + (event.getDamage() / 2));
@ -110,12 +108,22 @@ public class Combat
int hpLeft = defender.getHealth(), xpinc = 0;
if(hpLeft < event.getDamage())
{
if(hpLeft > 0)
xpinc = hpLeft;
else
xpinc = 0;
} else
xpinc = event.getDamage();
int xp = (int) (xpinc * 2 * LoadProperties.pvpxprewardmodifier);
if(xp < 0)
{
//Debug messages here
xp = Math.abs(xp); //Temporary fix
}
if(m.isAxes(attacker.getItemInHand()) && mcPermissions.getInstance().axes(attacker))
PPa.addXP(SkillType.AXES, xp*10, attacker);
if(m.isSwords(attacker.getItemInHand()) && mcPermissions.getInstance().swords(attacker))
@ -414,7 +422,12 @@ public class Combat
int hpLeft = le.getHealth(), xpinc = 0;
if(hpLeft < event.getDamage())
{
if(hpLeft > 0)
xpinc = hpLeft;
else
xpinc = 0;
}
else
xpinc = event.getDamage();