From d32818f3519db47a076b35da06d9e68ec1ea6fad Mon Sep 17 00:00:00 2001 From: MagicBot Date: Wed, 19 Jun 2024 17:27:04 -0400 Subject: [PATCH] Rearrange logic --- src/engine/objects/City.java | 51 ++++++++++++++++++++---------------- 1 file changed, 29 insertions(+), 22 deletions(-) diff --git a/src/engine/objects/City.java b/src/engine/objects/City.java index 9e003508..a597316f 100644 --- a/src/engine/objects/City.java +++ b/src/engine/objects/City.java @@ -301,18 +301,6 @@ public class City extends AbstractWorldObject { City city = (City) ago; - // Filter Lore cities - - if (ConfigManager.MB_RULESET.getValue().equals("LORE")) { - - if (!repledge) - if (!city.getGuild().charter.equals(playerCharacter.guild.charter)) - continue; - - if (!city.getGuild().charter.canJoin(playerCharacter)) - continue; - } - // Filter Player cities if (city.parentZone == null) @@ -320,6 +308,18 @@ public class City extends AbstractWorldObject { if (city.parentZone.guild_zone && city.isOpen() && city.getTOL().rank > 4 && city.getGuild().charter.equals(playerCharacter.guild.charter)) { + // Filter Lore cities + + if (ConfigManager.MB_RULESET.getValue().equals("LORE")) { + + if (!repledge) + if (!city.getGuild().charter.equals(playerCharacter.guild.charter)) + continue; + + if (!city.getGuild().charter.canJoin(playerCharacter)) + continue; + } + if (!city.getTOL().reverseKOS) { cities.add(city);//can teleport to any open ToL that shares charter continue; @@ -343,26 +343,33 @@ public class City extends AbstractWorldObject { // Filter NPC cities - if (city.cityName.equals("Perdition") || city.cityName.equals("Bastion")) - continue; // cannot teleport to perdition or bastion - if (city.isNoobIsle == 1 && playerCharacter.level <= 20) { cities.add(city); // everyone can go to noob island if they are under level 20 continue; } - if (city.cityName.equals("Khan'Ov Srekel")) { - cities.add(city); //everyone anytime can teleport to khan + if (city.isNpc == 1 && city.isNoobIsle == 0 && playerCharacter.level >= 20) { + cities.add(city); // Errants can travel everywhere off noob isle. continue; } - if (city.isNpc == 1 && city.getGuild().charter.equals(playerCharacter.guild.charter)) { - cities.add(city); // anyone of the same charter can teleport to a safehold of that charter - continue; + if (city.cityName.equals("Perdition") || city.cityName.equals("Bastion")) + continue; // cannot teleport to perdition or bastion + + // Filter Lore cities + + if (ConfigManager.MB_RULESET.getValue().equals("LORE")) { + + if (!repledge) + if (!city.getGuild().charter.equals(playerCharacter.guild.charter)) + continue; + + if (!city.getGuild().charter.canJoin(playerCharacter)) + continue; } - if (city.isNpc == 1 && city.isNoobIsle == 0 && playerCharacter.level >= 20) - cities.add(city); // Errants can travel everywhere off noob isle. + if (city.isNpc == 1) + cities.add(city); } return cities;