X-Git-Url: https://jxself.org/git/?a=blobdiff_plain;f=main.c;h=1c818ccd1e0101a7762ced17e085d261f47a1f9e;hb=992bdbf16cb230462865b31cc9004475e6ac9e86;hp=f8bf8a1cb4dc73a42172ce826d8ee3e06d88d7ed;hpb=8d9c8e4d5c035213bb41abc64c59fb25672e8e50;p=open-adventure.git diff --git a/main.c b/main.c index f8bf8a1..1c818cc 100644 --- a/main.c +++ b/main.c @@ -137,7 +137,7 @@ static bool fallback_handler(struct command_t command) /* fallback handler for commands not handled by FORTRANish parser */ { long sv; - char buf[LINESIZE]; + char buf[2 * LINESIZE + 1]; sprintf(buf, "%s %s", command.raw1, command.raw2); if (sscanf(buf, "seed %ld", &sv) == 1) { @@ -147,6 +147,11 @@ static bool fallback_handler(struct command_t command) --game.turns; return true; } + else if (sscanf(buf, "waste %ld", &sv) == 1) { + game.limit -= sv; + printf("Game limit is now %ld\n", game.limit); + return true; + } return false; }