From: Jason S. Ninneman Date: Thu, 22 Jun 2017 05:43:16 +0000 (-0700) Subject: Quick-fix the 'pillo bug'. X-Git-Tag: 1.1~165 X-Git-Url: https://jxself.org/git/?a=commitdiff_plain;h=97241e87d75a68c2cf2ba56a4cd561d979498c17;p=open-adventure.git Quick-fix the 'pillo bug'. Once parsing no longer depends on text being broken up into 5-char tokens, the ugly hack to adventure.yaml must go away. --- diff --git a/adventure.yaml b/adventure.yaml index 81cc864..9f10ce7 100644 --- a/adventure.yaml +++ b/adventure.yaml @@ -1050,8 +1050,8 @@ arbitrary_messages: !!omap - ONE_HIT: 'One of them gets you!' - NONE_HIT: 'None of them hits you!' - DONT_KNOW: 'Sorry, I don''t know the word "%s".' -- WHAT_DO: 'What do you want to do with the %L?' -- NO_SEE: 'I see no %L here.' +- WHAT_DO: 'What do you want to do with the %L%L?' # FIXME: %L%L should become %L once parsing no longer depends on packed tokens +- NO_SEE: 'I see no %L%L here.' # FIXME: %L%L should become %L once parsing no longer depends on packed tokens - DO_WHAT: '%C what?' - OKEY_DOKEY: 'Okay, "%s".' - GARNERED_POINTS: 'You have garnered %d out of a possible %d points, using %d turn%S.' diff --git a/misc.c b/misc.c index 28bd960..e42cbc9 100644 --- a/misc.c +++ b/misc.c @@ -101,6 +101,8 @@ void vspeak(const char* msg, va_list ap) size--; } else { long arg = va_arg(ap, long); + if (arg == -1) + arg = 0; i++; // Integer specifier. In order to accommodate the fact that PARMS can have both legitimate integers *and* packed tokens, stringify everything. Future work may eliminate the need for this. if (msg[i] == 'd') { diff --git a/tests/chainrelock.chk b/tests/chainrelock.chk index 76d0166..ca1ac8e 100644 --- a/tests/chainrelock.chk +++ b/tests/chainrelock.chk @@ -1289,9 +1289,9 @@ There are some keys on the ground here. There is food here. -> drop pillo +> drop pillow -I see no pillo here. +I see no pillow here. > drop vase diff --git a/tests/chainrelock.log b/tests/chainrelock.log index f86bb28..029d6e0 100644 --- a/tests/chainrelock.log +++ b/tests/chainrelock.log @@ -210,7 +210,7 @@ e u n plugh -drop pillo +drop pillow drop vase drop trident drop ebony @@ -266,4 +266,4 @@ in feed bear unlock chain lock chain -lock chain \ No newline at end of file +lock chain diff --git a/tests/pirate.chk b/tests/pirate.chk index 9600c7a..a4f5c8c 100644 --- a/tests/pirate.chk +++ b/tests/pirate.chk @@ -1289,9 +1289,9 @@ There are some keys on the ground here. There is food here. -> drop pillo +> drop pillow -I see no pillo here. +I see no pillow here. > drop vase diff --git a/tests/pirate.log b/tests/pirate.log index 061ca4c..a0241d1 100644 --- a/tests/pirate.log +++ b/tests/pirate.log @@ -210,7 +210,7 @@ e u n plugh -drop pillo +drop pillow drop vase drop trident drop ebony