diff options
Diffstat (limited to 'src/game/game.cpp')
-rw-r--r-- | src/game/game.cpp | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/src/game/game.cpp b/src/game/game.cpp index ddf9a75..f76b478 100644 --- a/src/game/game.cpp +++ b/src/game/game.cpp @@ -140,16 +140,27 @@ void state_t::command(v2f_t x) group_say(text::get(text::SAY_MOVING_GROUP)); for (unit_t *unit : selected_units) { - if (unit->dead) + unit_soldier_t *soldier; + + if (unit->type != unit_t::UNIT_SOLDIER) continue; - if (!unit->controllable) + soldier = dynamic_cast<unit_soldier_t*>(unit); + + if (soldier->dead) continue; - if (!unit->start_moving(snap)) - unit->say(text::get(text::SAY_NO_PATH)); - else if (selected_units.size() == 1) - unit->say(text::get(text::SAY_MOVING)); + if (!soldier->controllable) + continue; + + if (!soldier->start_moving(snap)) + soldier->say(text::get(text::SAY_NO_PATH)); + else { + soldier->move_marker = std::make_unique<fx_move_marker_t>(this, soldier->move.path.back()); + + if (selected_units.size() == 1) + soldier->say(text::get(text::SAY_MOVING)); + } } } |