Browse Source

UUID is in keyset

postwipe-1.5.2
MagicBot 6 months ago
parent
commit
533565e37e
  1. 39
      src/engine/objects/City.java

39
src/engine/objects/City.java

@ -318,6 +318,7 @@ public class City extends AbstractWorldObject { @@ -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 { @@ -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 {

Loading…
Cancel
Save