From 05bd55f720fd65337da03848a7c30d01a9b1fcc2 Mon Sep 17 00:00:00 2001 From: William Burns Date: Wed, 9 Dec 2015 23:53:04 +0000 Subject: [PATCH] iter --- .../game/games/gladiators/Gladiators.java | 42 ++++++++++--------- 1 file changed, 23 insertions(+), 19 deletions(-) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/gladiators/Gladiators.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/gladiators/Gladiators.java index c7a31c85e..d1c400b49 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/gladiators/Gladiators.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/gladiators/Gladiators.java @@ -2,6 +2,7 @@ package nautilus.game.arcade.game.games.gladiators; import java.util.ArrayList; import java.util.HashMap; +import java.util.Iterator; import java.util.LinkedList; import java.util.Map; import java.util.Queue; @@ -388,6 +389,28 @@ public class Gladiators extends SoloGame a.closeDoor(); } + @EventHandler + public void arenaCheckPlayer(UpdateEvent e) + { + if (!IsLive()) + return; + + if (e.getType() != UpdateType.TICK) + return; + + for (Arena a : _gameArenaSet) + { + Iterator pls = a.getPastPlayers().iterator(); + while (pls.hasNext()) + { + Player p = pls.next(); + + if (!GetPlayers(true).contains(p)) + pls.remove(); + } + } + } + @EventHandler public void arenaMoveCheck(PlayerMoveEvent e) { @@ -427,25 +450,6 @@ public class Gladiators extends SoloGame } } -// @EventHandler -// public void arenaCheckPlayer(UpdateEvent e) -// { -// if (!IsLive()) -// return; -// -// if (e.getType() != UpdateType.TICK) -// return; -// -// for (Arena a : _gameArenaSet) -// { -// for (Player p : a.getPastPlayers()) -// { -// if (!GetPlayers(true).contains(p)) -// a.getPastPlayers().remove(p); -// } -// } -// } - @EventHandler public void arenaChange(PlayerChangeArenaEvent e) {