Refactor scoring so score() does not conditionally exit.
This commit is contained in:
parent
f66cb0cdae
commit
704b86afbb
4 changed files with 30 additions and 27 deletions
14
actions.c
14
actions.c
|
@ -176,7 +176,7 @@ static void blast(void)
|
|||
if (HERE(ROD2))
|
||||
game.bonus = SPLATTER_MESSAGE;
|
||||
RSPEAK(game.bonus);
|
||||
score(endgame);
|
||||
terminate(endgame);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -793,7 +793,7 @@ static int quit(FILE *input)
|
|||
/* Quit. Intransitive only. Verify intent and exit if that's what he wants. */
|
||||
{
|
||||
if (YES(input, REALLY_QUIT, OK_MAN, OK_MAN))
|
||||
score(quitgame);
|
||||
terminate(quitgame);
|
||||
return GO_CLEAROBJ;
|
||||
}
|
||||
|
||||
|
@ -950,13 +950,6 @@ static int throw (FILE *cmdin, long verb, token_t obj)
|
|||
return throw_support((++game.dkill == 1) ? DWARF_SMOKE : KILLED_DWARF);
|
||||
}
|
||||
|
||||
static int vscore(void)
|
||||
/* Score. Call scoring routine but tell it to return. */
|
||||
{
|
||||
score(scoregame);
|
||||
return GO_CLEAROBJ;
|
||||
}
|
||||
|
||||
static int wake(token_t verb, token_t obj)
|
||||
/* Wake. Only use is to disturb the dwarves. */
|
||||
{
|
||||
|
@ -1120,7 +1113,8 @@ int action(FILE *input, enum speechpart part, long verb, token_t obj)
|
|||
blast();
|
||||
return GO_CLEAROBJ;
|
||||
case 23: /* SCOR */
|
||||
return vscore();
|
||||
score(scoregame);
|
||||
return GO_CLEAROBJ;
|
||||
case 24: /* FOO */
|
||||
return bigwords(WD1);
|
||||
case 25: /* BRIEF */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue