Simplify seed and waste cpmands using %d in the YAML string.

This commit is contained in:
Eric S. Raymond 2017-07-21 14:03:39 -04:00
parent 5337e00725
commit 80b2b9b356
2 changed files with 5 additions and 7 deletions

View file

@ -1247,8 +1247,8 @@ static int wake(verb_t verb, obj_t obj)
static int seed(verb_t verb, const char *arg)
/* Set seed */
{
long seed = atol(arg);
speak(actions[verb].message, arg);
int seed = atoi(arg);
speak(actions[verb].message, seed);
set_seed(seed);
--game.turns;
return GO_TOP;
@ -1258,9 +1258,7 @@ static int waste(verb_t verb, turn_t turns)
/* Burn turns */
{
game.limit -= turns;
char newlim[1024];
sprintf(newlim, "%ld", (long)game.limit);
speak(actions[verb].message, newlim);
speak(actions[verb].message, (int)game.limit);
return GO_TOP;
}