Fixed the negative XP bug on levelup.

Fixes #134
This commit is contained in:
nossr50 2012-02-14 12:09:02 -08:00
parent 939344816e
commit b5e4bebd75
3 changed files with 5 additions and 2 deletions

View File

@ -22,6 +22,7 @@ Version 1.2.11
- Added a success message when executing xprate from console - Added a success message when executing xprate from console
Version 1.2.10 Version 1.2.10
- Fixed issue that caused negative XP on levelup
- Fixed issue with receiving Woodcutting XP for all blocks broken (Issue #103) - Fixed issue with receiving Woodcutting XP for all blocks broken (Issue #103)
- Fixed issue with Spout images & sounds not working (Issue #93) - Fixed issue with Spout images & sounds not working (Issue #93)
- Fixed typo with repairing Leather Armor & Bows - Fixed typo with repairing Leather Armor & Bows

View File

@ -47,6 +47,7 @@ public class Database {
System.out.println("VendorError: " + e.getErrorCode()); System.out.println("VendorError: " + e.getErrorCode());
} }
} }
//Create the DB structure //Create the DB structure
public void createStructure() { public void createStructure() {
Write("CREATE TABLE IF NOT EXISTS `" + LoadProperties.MySQLtablePrefix + "huds` (`user_id` int(10) unsigned NOT NULL," Write("CREATE TABLE IF NOT EXISTS `" + LoadProperties.MySQLtablePrefix + "huds` (`user_id` int(10) unsigned NOT NULL,"

View File

@ -327,14 +327,15 @@ public class Skills
while(PP.getSkillXpLevel(skillType) >= PP.getXpToLevel(skillType)) while(PP.getSkillXpLevel(skillType) >= PP.getXpToLevel(skillType))
{ {
if(getSkillMaxLevel(skillType) >= PP.getSkillLevel(skillType) + 1) { if(getSkillMaxLevel(skillType) >= PP.getSkillLevel(skillType) + 1)
{
skillups++; skillups++;
PP.removeXP(skillType, PP.getXpToLevel(skillType));
PP.skillUp(skillType, 1); PP.skillUp(skillType, 1);
McMMOPlayerLevelUpEvent eventToFire = new McMMOPlayerLevelUpEvent(player, skillType); McMMOPlayerLevelUpEvent eventToFire = new McMMOPlayerLevelUpEvent(player, skillType);
Bukkit.getPluginManager().callEvent(eventToFire); Bukkit.getPluginManager().callEvent(eventToFire);
} }
PP.removeXP(skillType, PP.getXpToLevel(skillType));
} }
if(!LoadProperties.useMySQL) if(!LoadProperties.useMySQL)