From 97c54855d4e248266f77c43aad1cd3094f0d158a Mon Sep 17 00:00:00 2001 From: garbagemule Date: Tue, 25 Jun 2013 01:58:28 +0200 Subject: [PATCH] Attempt to fix some XP issues. --- src/com/garbagemule/MobArena/ArenaImpl.java | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/com/garbagemule/MobArena/ArenaImpl.java b/src/com/garbagemule/MobArena/ArenaImpl.java index 700fd87..8e086d8 100644 --- a/src/com/garbagemule/MobArena/ArenaImpl.java +++ b/src/com/garbagemule/MobArena/ArenaImpl.java @@ -435,6 +435,10 @@ public class ArenaImpl implements Arena //movePlayerToLocation(p, region.getArenaWarp()); setHealth(p, p.getMaxHealth()); p.setFoodLevel(20); + if (settings.getBoolean("display-waves-as-level", false)) { + p.setLevel(0); + p.setExp(0.0f); + } assignClassPermissions(p); arenaPlayerMap.get(p).resetStats(); @@ -555,6 +559,10 @@ public class ArenaImpl implements Arena MAUtils.sitPets(p); setHealth(p, p.getMaxHealth()); p.setFoodLevel(20); + if (settings.getBoolean("display-timer-as-level", false)) { + p.setLevel(0); + p.setExp(0.0f); + } p.setGameMode(GameMode.SURVIVAL); movePlayerToLobby(p); @@ -870,8 +878,12 @@ public class ArenaImpl implements Arena Messenger.severe("Failed to restore inventory for player " + p.getName() + "!"); } 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(); } else {