Experience is occasionally zero or cast to zero.

Fixes #1575 and fixes #1576
This commit is contained in:
Glitchfinder 2013-10-30 15:49:47 -07:00
parent 4889769522
commit d6c6c75157

View File

@ -468,7 +468,11 @@ public class McMMOPlayer {
* @param xp Experience amount to process
*/
public void beginXpGain(SkillType skill, float xp) {
Validate.isTrue(xp > 0, "XP gained should be greater than zero.");
Validate.isTrue(xp >= 0.0, "XP gained should be greater than or equal to zero.");
if (xp <= 0.0) {
return;
}
if (skill.isChildSkill()) {
Set<SkillType> parentSkills = FamilyTree.getParents(skill);