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