From ef43aaa830f54cd7faa195c53c286f3228d3f262 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Mon, 3 Oct 2016 16:28:18 +0200 Subject: [PATCH] eliminate some duplicate calculations. --- src/monsters.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/monsters.c b/src/monsters.c index 72decb304..4e3e47623 100644 --- a/src/monsters.c +++ b/src/monsters.c @@ -322,14 +322,10 @@ static direction_t random_neighbour(region * r, unit * u) for (i = 0; i != MAXDIRECTIONS; i++) { region *rn = next[i]; if (rn && can_survive(u, rn)) { - if (c2 == 0) { - c++; - } - else if (room_for_race_in_region(rn, rc)) { - c++; - } - if (c == rr) + c++; + if (c == rr) { return (direction_t)i; + } } }