Restructure some code.

This commit is contained in:
Eric S. Raymond 2017-06-19 09:46:04 -04:00
parent 10e53a419e
commit 0b91efc9eb

View file

@ -922,6 +922,7 @@ static int throw (FILE *cmdin, long verb, token_t obj)
} }
if (obj != AXE) if (obj != AXE)
return (discard(verb, obj, false)); return (discard(verb, obj, false));
else {
int i = ATDWRF(game.loc); int i = ATDWRF(game.loc);
if (i <= 0) { if (i <= 0) {
if (AT(DRAGON) && game.prop[DRAGON] == 0) if (AT(DRAGON) && game.prop[DRAGON] == 0)
@ -944,10 +945,13 @@ static int throw (FILE *cmdin, long verb, token_t obj)
if (randrange(NDWARVES + 1) < game.dflag) { if (randrange(NDWARVES + 1) < game.dflag) {
return throw_support(DWARF_DODGES); return throw_support(DWARF_DODGES);
} } else {
game.dseen[i] = false; game.dseen[i] = false;
game.dloc[i] = 0; game.dloc[i] = 0;
return throw_support((++game.dkill == 1) ? DWARF_SMOKE : KILLED_DWARF); return throw_support((++game.dkill == 1)
? DWARF_SMOKE : KILLED_DWARF);
}
}
} }
static int wake(token_t verb, token_t obj) static int wake(token_t verb, token_t obj)