summaryrefslogtreecommitdiff
path: root/src/game/units.cpp
diff options
context:
space:
mode:
authorPaweł Redman <pawel.redman@gmail.com>2017-12-19 13:31:40 +0100
committerPaweł Redman <pawel.redman@gmail.com>2017-12-19 13:31:40 +0100
commit1de83ba7bc556a1af61c1030cd3c649e37b5db25 (patch)
tree80b650b1fc739f149ba8773416368b6914bbe656 /src/game/units.cpp
parent4bc1bff7953404f3ce309349f9209e1a752a1f9d (diff)
Fix soldiers sometimes sliding when moving in a group.
Diffstat (limited to 'src/game/units.cpp')
-rw-r--r--src/game/units.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/game/units.cpp b/src/game/units.cpp
index a6edc48..691a099 100644
--- a/src/game/units.cpp
+++ b/src/game/units.cpp
@@ -99,6 +99,7 @@ bool unit_t::keep_moving(double speed)
return true;
time = game->dt * speed;
+ move.blocked = true;
while (time > 0.0f) {
v2f_t delta, next, x_new;
@@ -129,11 +130,11 @@ bool unit_t::keep_moving(double speed)
if (!world->test_rect(&cmodel_next, this)) {
x = x_new;
cmodel = cmodel_next;
+ move.blocked = false;
continue;
}
if (move.attempts_left) {
- move.blocked = true;
move.attempts_left--;
move.next_attempt = game->now + 0.2f;
} else {