mirror of
https://github.com/taoneill/war.git
synced 2024-11-13 05:54:31 +01:00
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:
parent
728111217e
commit
c4b268910b
@ -10,6 +10,7 @@ import com.tommytony.war.War;
|
||||
import com.tommytony.war.Warzone;
|
||||
import com.tommytony.war.structure.ZoneLobby;
|
||||
import java.util.Iterator;
|
||||
import org.kitteh.tag.TagAPI;
|
||||
|
||||
|
||||
public class ResetZoneCommand extends AbstractZoneMakerCommand {
|
||||
@ -50,6 +51,9 @@ public class ResetZoneCommand extends AbstractZoneMakerCommand {
|
||||
for (Iterator<Player> it = team.getPlayers().iterator(); it.hasNext();) {
|
||||
Player p = it.next();
|
||||
it.remove();
|
||||
if (War.war.isTagServer()) {
|
||||
TagAPI.refreshPlayer(p);
|
||||
}
|
||||
zone.restorePlayerState(p);
|
||||
p.teleport(zone.getTeleport());
|
||||
War.war.msg(p, "You have left the warzone. Your inventory is being restored.");
|
||||
|
@ -13,6 +13,7 @@ import com.tommytony.war.War;
|
||||
import com.tommytony.war.Warzone;
|
||||
import com.tommytony.war.spout.SpoutDisplayer;
|
||||
import java.util.Iterator;
|
||||
import org.kitteh.tag.TagAPI;
|
||||
|
||||
public class ScoreCapReachedJob implements Runnable {
|
||||
|
||||
@ -45,6 +46,9 @@ public class ScoreCapReachedJob implements Runnable {
|
||||
for (Iterator<Player> it = t.getPlayers().iterator(); it.hasNext();) {
|
||||
Player tp = it.next();
|
||||
it.remove(); // Remove player from team first to prevent anti-tp
|
||||
if (War.war.isTagServer()) {
|
||||
TagAPI.refreshPlayer(tp);
|
||||
}
|
||||
this.zone.gameEndTeleport(tp);
|
||||
if (this.winnersStr.contains(t.getName())) {
|
||||
// give reward
|
||||
|
Loading…
Reference in New Issue
Block a user