mirror of https://github.com/taoneill/war.git
Fix #750, rotate lobbies
This commit is contained in:
parent
9c3c43c4f6
commit
b772b71803
|
@ -34,11 +34,12 @@ public class SetZoneLobbyCommand extends AbstractZoneMakerCommand {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
Player player = (Player) this.getSender();
|
Player player = (Player) this.getSender();
|
||||||
|
ZoneLobby origLobby = null;
|
||||||
Warzone zone = Warzone.getZoneByLocation((Player) this.getSender());
|
Warzone zone = Warzone.getZoneByLocation((Player) this.getSender());
|
||||||
if (zone == null) {
|
if (zone == null) {
|
||||||
ZoneLobby lobby = ZoneLobby.getLobbyByLocation((Player) this.getSender());
|
origLobby = ZoneLobby.getLobbyByLocation((Player) this.getSender());
|
||||||
if (lobby != null) {
|
if (origLobby != null) {
|
||||||
zone = lobby.getZone();
|
zone = origLobby.getZone();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -75,6 +76,12 @@ public class SetZoneLobbyCommand extends AbstractZoneMakerCommand {
|
||||||
} else {
|
} else {
|
||||||
// Inside a warzone: use the classic n/s/e/w mode
|
// Inside a warzone: use the classic n/s/e/w mode
|
||||||
if (!this.args[0].equals("north") && !this.args[0].equals("n") && !this.args[0].equals("east") && !this.args[0].equals("e") && !this.args[0].equals("south") && !this.args[0].equals("s") && !this.args[0].equals("west") && !this.args[0].equals("w")) {
|
if (!this.args[0].equals("north") && !this.args[0].equals("n") && !this.args[0].equals("east") && !this.args[0].equals("e") && !this.args[0].equals("south") && !this.args[0].equals("s") && !this.args[0].equals("west") && !this.args[0].equals("w")) {
|
||||||
|
if (Warzone.getZoneByName(this.args[0]) == zone && origLobby != null) {
|
||||||
|
origLobby.setLocation(player.getLocation());
|
||||||
|
origLobby.initialize();
|
||||||
|
this.msg("Warzone lobby moved to your location.");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
ZoneLobby lobby = zone.getLobby();
|
ZoneLobby lobby = zone.getLobby();
|
||||||
|
|
Loading…
Reference in New Issue