summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPaweł Redman <pawel.redman@gmail.com>2017-12-13 20:35:29 +0100
committerPaweł Redman <pawel.redman@gmail.com>2017-12-13 20:35:29 +0100
commitab3e10a812ffdc89fc288bc965fa9d40459d2de8 (patch)
tree9fbf469f7105ac6405842cc11c3b4d63da9dd728 /src
parented3a6c7e1771100e81c53cc583828712d029b018 (diff)
Allow selecting dead humans.
Diffstat (limited to 'src')
-rw-r--r--src/game/game.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/game/game.cpp b/src/game/game.cpp
index 04034f7..5643b3a 100644
--- a/src/game/game.cpp
+++ b/src/game/game.cpp
@@ -54,9 +54,6 @@ void state_t::select(rectf_t x)
if (unit->type != unit_t::UNIT_HUMAN)
continue;
- if (unit->dead)
- continue;
-
unit->selected = selection_cookie;
selected_units.insert(unit);
}
@@ -69,8 +66,12 @@ void state_t::command(v2f_t x)
snap[0] = std::round(x[0] - 0.5f) + 0.5f;
snap[1] = std::round(x[1] - 0.5f) + 0.5f;
- for (unit_t *unit : selected_units)
+ for (unit_t *unit : selected_units) {
+ if (unit->dead)
+ continue;
+
unit->start_moving(snap, now);
+ }
}
void state_t::tick(double now_, double dt_)