forked from github/server
eliminate some duplicate calculations.
This commit is contained in:
parent
42e75007c3
commit
ef43aaa830
|
@ -322,16 +322,12 @@ static direction_t random_neighbour(region * r, unit * u)
|
||||||
for (i = 0; i != MAXDIRECTIONS; i++) {
|
for (i = 0; i != MAXDIRECTIONS; i++) {
|
||||||
region *rn = next[i];
|
region *rn = next[i];
|
||||||
if (rn && can_survive(u, rn)) {
|
if (rn && can_survive(u, rn)) {
|
||||||
if (c2 == 0) {
|
|
||||||
c++;
|
c++;
|
||||||
}
|
if (c == rr) {
|
||||||
else if (room_for_race_in_region(rn, rc)) {
|
|
||||||
c++;
|
|
||||||
}
|
|
||||||
if (c == rr)
|
|
||||||
return (direction_t)i;
|
return (direction_t)i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
assert(1 == 0); /* Bis hierhin sollte er niemals kommen. */
|
assert(1 == 0); /* Bis hierhin sollte er niemals kommen. */
|
||||||
return NODIRECTION;
|
return NODIRECTION;
|
||||||
|
|
Loading…
Reference in New Issue