Fixed /ma leave, thanks Paul!

This commit is contained in:
Garbage Mule 2011-08-04 23:21:39 +02:00
parent aac0a6bb0d
commit 1b1e1704c0
2 changed files with 21 additions and 7 deletions

Binary file not shown.

View File

@ -293,12 +293,17 @@ public class Arena
public void playerLeave(Player p)
{
if (arenaPlayers.contains(p) || lobbyPlayers.contains(p))
//if (arenaPlayers.contains(p) || lobbyPlayers.contains(p))
// MAUtils.clearInventory(p);
if (arenaPlayers.contains(p))
finishArenaPlayer(p);
else if (lobbyPlayers.contains(p))
MAUtils.clearInventory(p);
restoreInvAndGiveRewards(p);
if (log != null && log.players.get(p) != null)
log.players.get(p).lastWave = spawnThread.getWave() - 1;
//restoreInvAndGiveRewards(p);
//if (log != null && log.players.get(p) != null)
// log.players.get(p).lastWave = spawnThread.getWave() - 1;
movePlayerToEntry(p);
finishWithPlayer(p);
endArena();
@ -306,9 +311,11 @@ public class Arena
public void playerDeath(Player p)
{
MAUtils.clearInventory(p);
restoreInvAndGiveRewards(p);
log.players.get(p).lastWave = spawnThread.getWave() - 1;
//MAUtils.clearInventory(p);
//restoreInvAndGiveRewards(p);
//log.players.get(p).lastWave = spawnThread.getWave() - 1;
finishArenaPlayer(p);
if (specOnDeath)
{
@ -491,6 +498,13 @@ public class Arena
resetPlayer(p);
}
private void finishArenaPlayer(Player p)
{
MAUtils.clearInventory(p);
restoreInvAndGiveRewards(p);
log.players.get(p).lastWave = spawnThread.getWave() - 1;
}
/*////////////////////////////////////////////////////////////////////