Refresh player tags anytime players leave a zone

This fixes a bug where player tags are not reset when a zone ends normally
or when the zone is reset.
This commit is contained in:
cmastudios 2013-06-11 23:28:26 -05:00
parent 728111217e
commit c4b268910b
2 changed files with 8 additions and 0 deletions

View File

@ -10,6 +10,7 @@ import com.tommytony.war.War;
import com.tommytony.war.Warzone; import com.tommytony.war.Warzone;
import com.tommytony.war.structure.ZoneLobby; import com.tommytony.war.structure.ZoneLobby;
import java.util.Iterator; import java.util.Iterator;
import org.kitteh.tag.TagAPI;
public class ResetZoneCommand extends AbstractZoneMakerCommand { public class ResetZoneCommand extends AbstractZoneMakerCommand {
@ -50,6 +51,9 @@ public class ResetZoneCommand extends AbstractZoneMakerCommand {
for (Iterator<Player> it = team.getPlayers().iterator(); it.hasNext();) { for (Iterator<Player> it = team.getPlayers().iterator(); it.hasNext();) {
Player p = it.next(); Player p = it.next();
it.remove(); it.remove();
if (War.war.isTagServer()) {
TagAPI.refreshPlayer(p);
}
zone.restorePlayerState(p); zone.restorePlayerState(p);
p.teleport(zone.getTeleport()); p.teleport(zone.getTeleport());
War.war.msg(p, "You have left the warzone. Your inventory is being restored."); War.war.msg(p, "You have left the warzone. Your inventory is being restored.");

View File

@ -13,6 +13,7 @@ import com.tommytony.war.War;
import com.tommytony.war.Warzone; import com.tommytony.war.Warzone;
import com.tommytony.war.spout.SpoutDisplayer; import com.tommytony.war.spout.SpoutDisplayer;
import java.util.Iterator; import java.util.Iterator;
import org.kitteh.tag.TagAPI;
public class ScoreCapReachedJob implements Runnable { public class ScoreCapReachedJob implements Runnable {
@ -45,6 +46,9 @@ public class ScoreCapReachedJob implements Runnable {
for (Iterator<Player> it = t.getPlayers().iterator(); it.hasNext();) { for (Iterator<Player> it = t.getPlayers().iterator(); it.hasNext();) {
Player tp = it.next(); Player tp = it.next();
it.remove(); // Remove player from team first to prevent anti-tp it.remove(); // Remove player from team first to prevent anti-tp
if (War.war.isTagServer()) {
TagAPI.refreshPlayer(tp);
}
this.zone.gameEndTeleport(tp); this.zone.gameEndTeleport(tp);
if (this.winnersStr.contains(t.getName())) { if (this.winnersStr.contains(t.getName())) {
// give reward // give reward