Skip to content

Commit

Permalink
will only activate shoot task if target is attackable
Browse files Browse the repository at this point in the history
  • Loading branch information
samsully committed Sep 10, 2023
1 parent 9372179 commit f832a84
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ public int getPriority() {
* @return (int) active priority if a target is visible, -1 otherwise
*/
private int getActivePriority() {
if ((startTime + delay) < timeSource.getTime() && isTargetVisible()) {
if ((startTime + delay) < timeSource.getTime() && isTargetVisible() && this.meleeOrProjectile() != null) {
return priority;
}
return -1;
Expand All @@ -191,7 +191,7 @@ private int getActivePriority() {
* @return (int) -1 if a target is not visible, active priority otherwise
*/
private int getInactivePriority() {
if ((startTime + delay) < timeSource.getTime() && isTargetVisible()) {
if ((startTime + delay) < timeSource.getTime() && isTargetVisible() && this.meleeOrProjectile() != null) {
return priority;
}
return -1;
Expand Down

0 comments on commit f832a84

Please sign in to comment.