Fix game end TP bugs caused by a5cd846

Remove players from team before teleporting them back to lobby or
rallypoint.
This commit is contained in:
cmastudios 2013-05-31 17:03:36 -05:00
parent 3b0b0c6720
commit 728111217e
1 changed files with 4 additions and 3 deletions

View File

@ -12,6 +12,7 @@ import com.tommytony.war.Team;
import com.tommytony.war.War;
import com.tommytony.war.Warzone;
import com.tommytony.war.spout.SpoutDisplayer;
import java.util.Iterator;
public class ScoreCapReachedJob implements Runnable {
@ -41,10 +42,10 @@ public class ScoreCapReachedJob implements Runnable {
String winnersStrAndExtra = "Score cap reached. Game is over! Winning team(s): " + this.winnersStr;
winnersStrAndExtra += ". Resetting warzone and your inventory...";
t.teamcast(winnersStrAndExtra);
for (Player tp : t.getPlayers()) {
// Send everyone to rally point (or zone lobby if not rally point)
for (Iterator<Player> it = t.getPlayers().iterator(); it.hasNext();) {
Player tp = it.next();
it.remove(); // Remove player from team first to prevent anti-tp
this.zone.gameEndTeleport(tp);
if (this.winnersStr.contains(t.getName())) {
// give reward
for (Integer slot : t.getInventories().resolveReward().keySet()) {