From 533565e37eaa3320c073cb33d8e86416b4f1514c Mon Sep 17 00:00:00 2001 From: MagicBot Date: Mon, 24 Jun 2024 03:09:38 -0400 Subject: [PATCH] UUID is in keyset --- src/engine/objects/City.java | 39 +++++++++++++++++------------------- 1 file changed, 18 insertions(+), 21 deletions(-) diff --git a/src/engine/objects/City.java b/src/engine/objects/City.java index 7c177df8..1b9c438e 100644 --- a/src/engine/objects/City.java +++ b/src/engine/objects/City.java @@ -318,6 +318,7 @@ public class City extends AbstractWorldObject { cities.add(city); continue; } + if (city.isOpen() && city.getTOL().rank > 4) { // Filter Lore cities @@ -330,41 +331,37 @@ public class City extends AbstractWorldObject { else if (!city.getGuild().charter.canJoin(playerCharacter)) continue; } + Integer playerUUID = playerCharacter.objectUUID; Integer guildUUID = playerCharacter.guildUUID; Integer nationUUID = playerCharacter.guild.getNation().getObjectUUID(); boolean allowed = false; + if (city.getTOL().reverseKOS) { + //reverse KOS, specific values are allowed - if (city.getTOL().getCondemned().contains(playerUUID) && city.getTOL().getCondemned().get(playerUUID).active) { - //individual is cleared for teleport/repledge - allowed = true; - } else if (city.getTOL().getCondemned().contains(guildUUID) && city.getTOL().getCondemned().get(guildUUID).active) { - //player guild is cleared for teleport/repledge - allowed = true; - } else if (city.getTOL().getCondemned().contains(nationUUID) && city.getTOL().getCondemned().get(nationUUID).active) { - //player nation is cleared for teleport/repledge + + if ((city.getTOL().getCondemned().containsKey(playerUUID) && city.getTOL().getCondemned().get(playerUUID).active) || + (city.getTOL().getCondemned().containsKey(guildUUID) && city.getTOL().getCondemned().get(guildUUID).active) || + (city.getTOL().getCondemned().containsKey(nationUUID) && city.getTOL().getCondemned().get(nationUUID).active)) allowed = true; - } + } else { //not reverse KOS, everyone is allowed by default + allowed = true; + //specific values are not allowed - if (city.getTOL().getCondemned().contains(playerUUID) && city.getTOL().getCondemned().get(playerUUID).active) { - //individual is cleared for teleport/repledge - allowed = false; - } else if (city.getTOL().getCondemned().contains(guildUUID) && city.getTOL().getCondemned().get(guildUUID).active) { - //player guild is cleared for teleport/repledge - allowed = false; - } else if (city.getTOL().getCondemned().contains(nationUUID) && city.getTOL().getCondemned().get(nationUUID).active) { - //player nation is cleared for teleport/repledge + + if ((city.getTOL().getCondemned().containsKey(playerUUID) && city.getTOL().getCondemned().get(playerUUID).active) || + (city.getTOL().getCondemned().containsKey(guildUUID) && city.getTOL().getCondemned().get(guildUUID).active) || + (city.getTOL().getCondemned().containsKey(nationUUID) && city.getTOL().getCondemned().get(nationUUID).active)) allowed = false; - } + } - if (allowed) { + + if (allowed) cities.add(city); - continue; - } } } else {