summaryrefslogtreecommitdiff
path: root/sim/src
diff options
context:
space:
mode:
Diffstat (limited to 'sim/src')
-rw-r--r--sim/src/BaseBattle.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/sim/src/BaseBattle.cpp b/sim/src/BaseBattle.cpp
index 9587ca7..17dc739 100644
--- a/sim/src/BaseBattle.cpp
+++ b/sim/src/BaseBattle.cpp
@@ -136,6 +136,8 @@ BaseBattle::turrets(const float dt)
auto& target_points = _registry.get<HitPoints>(state.target);
const auto& target = _registry.get<Transform>(state.target);
const auto distance = transform.position - target.position;
+ if (distance.magnitude() > def.optimal_range * 2.5)
+ continue;
const auto damage = effective_damage(def, distance.magnitude());
if (damage > 0.0) {
target_points.health -= damage;