Skip to content
This repository has been archived by the owner on May 16, 2024. It is now read-only.

Commit

Permalink
Update tower target search criteria
Browse files Browse the repository at this point in the history
Signed-off-by: Yura2108 <yugk2108@yandex.ru>
  • Loading branch information
Yura2108 authored and John Doe committed May 8, 2024
1 parent 1c3e829 commit 973a914
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -465,8 +465,8 @@ class TowerDefenceInstance private constructor(
val nearbyMonster = miniGameWorldInstance.instance
.getNearbyEntities(towerData.position, towerData.attackRange.toDouble())
.filterIsInstance<EntityCreature>()
.minByOrNull {
it.getNavigatorIndex() ?: Int.MAX_VALUE
.maxByOrNull {
it.getNavigatorIndex() ?: -1
}

if(nearbyMonster == null) continue
Expand Down

0 comments on commit 973a914

Please sign in to comment.