make kq not enumerate local players twice

This commit is contained in:
Player Name 2026-07-15 08:03:02 +02:00
parent 9c42c7e4c9
commit 2297aa6b32

View file

@ -315,12 +315,10 @@ public final class KalphiteQueenNPC extends AbstractNPC {
return;
}
if (style == CombatStyle.MAGIC) {
BattleState[] states = new BattleState[RegionManager.getLocalPlayers(entity.getLocation()).size() + 1];
List<Player> localPlayers = RegionManager.getLocalPlayers(entity.getLocation());
BattleState[] states = new BattleState[localPlayers.size() + 1];
int index = 1;
if (states.length == 0) {
return;
}
for (Player p : RegionManager.getLocalPlayers(entity.getLocation())) {
for (Player p : localPlayers) {
if (p != victim) {
states[index++] = new BattleState(entity, p);
}