summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/game.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/game.cpp b/src/game.cpp
index a3af9ed..8daa7d0 100644
--- a/src/game.cpp
+++ b/src/game.cpp
@@ -237,8 +237,13 @@ void state_t::select(rectf_t x)
void state_t::command(v2f_t x)
{
+ v2f_t snap;
+
+ 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)
- unit->start_moving(x, now);
+ unit->start_moving(snap, now);
}
void state_t::tick(double now_, double dt_)