From a32ba5e262ddca703aab1a0f87083d27516cbb17 Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Sat, 17 Feb 2024 20:31:53 -0600 Subject: [PATCH] track range changes --- src/engine/gameManager/PowersManager.java | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/engine/gameManager/PowersManager.java b/src/engine/gameManager/PowersManager.java index b9922944..cc723cc2 100644 --- a/src/engine/gameManager/PowersManager.java +++ b/src/engine/gameManager/PowersManager.java @@ -1461,6 +1461,27 @@ public enum PowersManager { HashSet trackChars = RangeBasedAwo.getTrackList( allTargets, playerCharacter, maxTargets); + trackChars = new HashSet<>(); + HashSet allInRange = WorldGrid.getObjectsInRangePartial(playerCharacter.loc,MBServerStatics.CHARACTER_LOAD_RANGE,MBServerStatics.MASK_PLAYER); + ArrayList nationsInRange = new ArrayList<>(); + //first round to add players in range + for(AbstractWorldObject trackChar : allInRange){ + if(allInRange.contains(trackChar)) { + trackChars.add((AbstractCharacter)trackChar); + Guild nation = ((AbstractCharacter)trackChar).guild.getNation(); + if(nationsInRange.contains(nation) == false) + nationsInRange.add(nation); + } + } + //second round add all others in window if they share a nation with a current + for(AbstractWorldObject trackChar : allInRange) { + Guild nation = ((AbstractCharacter) trackChar).guild.getNation(); + if (allInRange.contains(trackChar) == true && nationsInRange.add(nation) == true && trackChars.contains(trackChar) == false) + trackChars.add((AbstractCharacter) trackChar); + else if(((AbstractCharacter) trackChar).guild.getNation().equals(playerCharacter.guild.getNation())) + trackChars.add((AbstractCharacter) trackChar); + } + TrackWindowMsg trackWindowMsg = new TrackWindowMsg(msg); // send track window