From 26a416c5badf08a2820b3df1d8a2f664bff115c0 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Mon, 3 Oct 2016 16:38:17 +0200 Subject: [PATCH] do not call can_survive all this much. --- src/monsters.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/monsters.c b/src/monsters.c index 4e3e47623..2678c284e 100644 --- a/src/monsters.c +++ b/src/monsters.c @@ -299,6 +299,8 @@ static direction_t random_neighbour(region * r, unit * u) next[i] = NULL; } c2++; + } else { + next[i] = NULL; } } @@ -321,7 +323,7 @@ static direction_t random_neighbour(region * r, unit * u) c = -1; for (i = 0; i != MAXDIRECTIONS; i++) { region *rn = next[i]; - if (rn && can_survive(u, rn)) { + if (rn) { c++; if (c == rr) { return (direction_t)i;