diff options
Diffstat (limited to 'sim/src')
-rw-r--r-- | sim/src/TurretControl.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sim/src/TurretControl.cpp b/sim/src/TurretControl.cpp index ba54f3f..51f2a46 100644 --- a/sim/src/TurretControl.cpp +++ b/sim/src/TurretControl.cpp @@ -1,6 +1,7 @@ #include <kurator/sim/TurretControl.h> #include <kurator/sim/components.h> +#include <kurator/sim/FloatingMovement.h> #include <kurator/sim/HitPoints.h> #include <kurator/sim/events.h> #include <kurator/sim/State.h> @@ -40,7 +41,8 @@ TurretControl::update(State& ctx) control.rounds = def.rounds; if (control.rounds > 0 && consume(remaining_dt, control.delay)) { auto& target_points = ctx.registry.get<HitPoints>(state.target); - auto damage = def.effective_damage(distance); + const auto& movement = ctx.registry.get<FloatingMovement>(state.target); + auto damage = def.effective_damage(distance, movement.speed.magnitude()); if (damage > 0.0) { damage = target_points.deal(damage); ctx.dispatcher.trigger(Hit{damage, control.owner, state.target}); |