Quick-fix the 'pillo bug'. 130/head
authorJason S. Ninneman <jsn@mbar.us>
Thu, 22 Jun 2017 05:43:16 +0000 (22:43 -0700)
committerJason S. Ninneman <jsn@mbar.us>
Thu, 22 Jun 2017 05:43:16 +0000 (22:43 -0700)
Once parsing no longer depends on text being broken up into
5-char tokens, the ugly hack to adventure.yaml must go away.

adventure.yaml
misc.c
tests/chainrelock.chk
tests/chainrelock.log
tests/pirate.chk
tests/pirate.log

index 81cc864d26e9f1a9af6bc2e3e806a50d609640e0..9f10ce72c8b5cd092978af2ff62bdd7b03b23ca4 100644 (file)
@@ -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".'
 - 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.'
 - 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 28bd960f39ba314fdfca79da4b799ec351ba114f..e42cbc915a7582e78d44ad2f055c8f970437a6b1 100644 (file)
--- 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);
             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') {
             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') {
index 76d0166a1de03b1ffc8aea41b2211231ef5ad9b3..ca1ac8e1cb6d02092f4a1c6e9c266ebc5945038f 100644 (file)
@@ -1289,9 +1289,9 @@ There are some keys on the ground here.
 
 There is food here.
 
 
 There is food here.
 
-> drop pillo
+> drop pillow
 
 
-I see no pillo here.
+I see no pillow here.
 
 > drop vase
 
 
 > drop vase
 
index f86bb287ec4637c84a9b108c2417be85c850d5a2..029d6e08b2b864e8843f0bd703481056ddb0baf3 100644 (file)
@@ -210,7 +210,7 @@ e
 u
 n
 plugh
 u
 n
 plugh
-drop pillo
+drop pillow
 drop vase
 drop trident
 drop ebony
 drop vase
 drop trident
 drop ebony
@@ -266,4 +266,4 @@ in
 feed bear
 unlock chain
 lock chain
 feed bear
 unlock chain
 lock chain
-lock chain
\ No newline at end of file
+lock chain
index 9600c7a6deae69d3632238e3300bbf6679569512..a4f5c8c675222a0e4a4221598d473edfa0a94e8e 100644 (file)
@@ -1289,9 +1289,9 @@ There are some keys on the ground here.
 
 There is food here.
 
 
 There is food here.
 
-> drop pillo
+> drop pillow
 
 
-I see no pillo here.
+I see no pillow here.
 
 > drop vase
 
 
 > drop vase
 
index 061ca4c0c1a11ccab2741e66f4362b69a05a50f6..a0241d11c5e031ba18f5d29c4b97c0e36f33ba48 100644 (file)
@@ -210,7 +210,7 @@ e
 u
 n
 plugh
 u
 n
 plugh
-drop pillo
+drop pillow
 drop vase
 drop trident
 drop ebony
 drop vase
 drop trident
 drop ebony