summaryrefslogtreecommitdiff
path: root/src/game/units.cpp
diff options
context:
space:
mode:
authorPaweł Redman <pawel.redman@gmail.com>2018-04-13 13:48:01 +0200
committerPaweł Redman <pawel.redman@gmail.com>2018-04-13 13:48:01 +0200
commite77c5b1e01eeb55625d8cf072bedd5a34658b865 (patch)
tree683a2ecb2bfae408a0a3f351c203b9a1b372ed76 /src/game/units.cpp
parent1378213595c5072625003ddeffa4986b64940c53 (diff)
Better random walking so spiders don't get stuck so often.
Diffstat (limited to 'src/game/units.cpp')
-rw-r--r--src/game/units.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/game/units.cpp b/src/game/units.cpp
index 6bce474..e7263c0 100644
--- a/src/game/units.cpp
+++ b/src/game/units.cpp
@@ -271,7 +271,11 @@ void unit_t::random_walk(void)
game->time - move.random_walk_time < MSEC(1000))
return;
- start_moving(x + game->prng.unit_vec2() * 10);
+ move.moving = true;
+ move.blocked = false;
+ move.dst = x + game->prng.unit_vec2() * 10;
+ move.path.clear();
+ move.path.push_back(move.dst);
move.random_walk_time = game->time;
}