summaryrefslogtreecommitdiff
path: root/src/game/unit_soldier.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/unit_soldier.cpp')
-rw-r--r--src/game/unit_soldier.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/game/unit_soldier.cpp b/src/game/unit_soldier.cpp
index b3e93d1..7dca7ff 100644
--- a/src/game/unit_soldier.cpp
+++ b/src/game/unit_soldier.cpp
@@ -123,14 +123,18 @@ void unit_soldier_t::target_and_attack(void)
next_targetting = game->now + 0.2;
target = find_target(world, x, 5.0f, false);
- if (!target)
+ if (!target) {
+ aim_marker.reset();
return;
+ }
aim = target->x;
last_target_time = game->now;
last_target_x = target->x;
skip_targetting:
+ aim_marker = std::make_unique<fx_aim_marker_t>(game, aim);
+
if (last_attack + game->prng.next_float(1.4f, 1.6f) > game->now)
return;
@@ -167,6 +171,7 @@ void unit_soldier_t::on_death(void)
controllable = false;
game->selected_units.erase(this);
move_marker.reset();
+ aim_marker.reset();
}
void unit_soldier_t::render_to(render::state_t *render)