Attempt to fix some XP issues.

This commit is contained in:
garbagemule 2013-06-25 01:58:28 +02:00
parent e2bae68db1
commit 97c54855d4

View File

@ -435,6 +435,10 @@ public class ArenaImpl implements Arena
//movePlayerToLocation(p, region.getArenaWarp()); //movePlayerToLocation(p, region.getArenaWarp());
setHealth(p, p.getMaxHealth()); setHealth(p, p.getMaxHealth());
p.setFoodLevel(20); p.setFoodLevel(20);
if (settings.getBoolean("display-waves-as-level", false)) {
p.setLevel(0);
p.setExp(0.0f);
}
assignClassPermissions(p); assignClassPermissions(p);
arenaPlayerMap.get(p).resetStats(); arenaPlayerMap.get(p).resetStats();
@ -555,6 +559,10 @@ public class ArenaImpl implements Arena
MAUtils.sitPets(p); MAUtils.sitPets(p);
setHealth(p, p.getMaxHealth()); setHealth(p, p.getMaxHealth());
p.setFoodLevel(20); p.setFoodLevel(20);
if (settings.getBoolean("display-timer-as-level", false)) {
p.setLevel(0);
p.setExp(0.0f);
}
p.setGameMode(GameMode.SURVIVAL); p.setGameMode(GameMode.SURVIVAL);
movePlayerToLobby(p); movePlayerToLobby(p);
@ -870,8 +878,12 @@ public class ArenaImpl implements Arena
Messenger.severe("Failed to restore inventory for player " + p.getName() + "!"); Messenger.severe("Failed to restore inventory for player " + p.getName() + "!");
} }
rewardManager.grantRewards(p); rewardManager.grantRewards(p);
if (lobbyPlayers.contains(p) || !settings.getBoolean("keep-exp", false)) { // Try to prevent XP issues
if (lobbyPlayers.contains(p)
|| !settings.getBoolean("keep-exp")
|| settings.getBoolean("display-waves-as-level", false)
|| settings.getBoolean("display-timer-as-level", false)) {
playerData.get(p).restoreData(); playerData.get(p).restoreData();
} }
else { else {