Rewrite dwarf-encounter ceck so coverage testing sees all predicates.
This commit is contained in:
parent
4f08537e2d
commit
a6954db376
1 changed files with 20 additions and 14 deletions
32
main.c
32
main.c
|
@ -381,21 +381,27 @@ static bool dwarfmove(void)
|
||||||
do {
|
do {
|
||||||
game.newloc = travel[kk].dest;
|
game.newloc = travel[kk].dest;
|
||||||
/* Have we avoided a dwarf encounter? */
|
/* Have we avoided a dwarf encounter? */
|
||||||
bool avoided = (SPECIAL(game.newloc) ||
|
if (SPECIAL(game.newloc))
|
||||||
!INDEEP(game.newloc) ||
|
continue;
|
||||||
game.newloc == game.odloc[i] ||
|
else if (!INDEEP(game.newloc))
|
||||||
(j > 1 && game.newloc == tk[j - 1]) ||
|
continue;
|
||||||
j >= DIM(tk) - 1 ||
|
else if (game.newloc == game.odloc[i])
|
||||||
game.newloc == game.dloc[i] ||
|
continue;
|
||||||
FORCED(game.newloc) ||
|
else if (j > 1 && game.newloc == tk[j - 1])
|
||||||
(i == PIRATE && CNDBIT(game.newloc, COND_NOARRR)) ||
|
continue;
|
||||||
travel[kk].nodwarves);
|
else if (j >= DIM(tk) - 1)
|
||||||
if (!avoided) {
|
continue;
|
||||||
|
else if (game.newloc == game.dloc[i])
|
||||||
|
continue;
|
||||||
|
else if (FORCED(game.newloc))
|
||||||
|
continue;
|
||||||
|
else if (i == PIRATE && CNDBIT(game.newloc, COND_NOARRR))
|
||||||
|
continue;
|
||||||
|
else if (travel[kk].nodwarves)
|
||||||
|
continue;
|
||||||
tk[j++] = game.newloc;
|
tk[j++] = game.newloc;
|
||||||
}
|
|
||||||
++kk;
|
|
||||||
} while
|
} while
|
||||||
(!travel[kk - 1].stop);
|
(!travel[kk++].stop);
|
||||||
tk[j] = game.odloc[i];
|
tk[j] = game.odloc[i];
|
||||||
if (j >= 2)
|
if (j >= 2)
|
||||||
--j;
|
--j;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue