- Joined
- Nov 5, 2014
- Messages
- 505
- Thread Author
- #1
I'm having loads of trouble trying to establish if the local player is in combat, methods which have worked fine in the past are now not working correctly.
I've tried a few different ways, but this is the method which I have used in the past which is consistently returning false even when the player is attacking and being attacked by loads of different npcs.
Any idea what's up with this?
Thanks
@Cloud
I've tried a few different ways, but this is the method which I have used in the past which is consistently returning false even when the player is attacking and being attacked by loads of different npcs.
Code:
private Boolean isInCombat(Actor a) {
return a.getTarget() != null || !Npcs.newQuery().within(fightArea).filter(new Filter<Npc>() {
@Override
public boolean accepts(Npc npc) {
return npc.getTarget() == a;
}
}).results().isEmpty();
}
Any idea what's up with this?
Thanks
@Cloud