Prevent game from uttering solecisms about the "floor" when outside.
authorEric S. Raymond <esr@thyrsus.com>
Wed, 12 Jul 2017 04:19:16 +0000 (00:19 -0400)
committerEric S. Raymond <esr@thyrsus.com>
Wed, 12 Jul 2017 04:19:16 +0000 (00:19 -0400)
advent.h
misc.c
notes.adoc
tests/fillvase.chk

index 3015d65d1f2b65b3768dc5c070b697c08dbb6559..44839a899c81a0c30f7b6600043c06e6631de309 100644 (file)
--- a/advent.h
+++ b/advent.h
 #define GSTONE(OBJ)  ((OBJ) == EMERALD || (OBJ) == RUBY || (OBJ) == AMBER || (OBJ) == SAPPH)
 #define FOREST(LOC)  CNDBIT(LOC, COND_FOREST)
 #define OUTSID(LOC)  (CNDBIT(LOC, COND_ABOVE) || FOREST(LOC))
 #define GSTONE(OBJ)  ((OBJ) == EMERALD || (OBJ) == RUBY || (OBJ) == AMBER || (OBJ) == SAPPH)
 #define FOREST(LOC)  CNDBIT(LOC, COND_FOREST)
 #define OUTSID(LOC)  (CNDBIT(LOC, COND_ABOVE) || FOREST(LOC))
+#define INSIDE(LOC)  (!OUTSID(LOC) || LOC == LOC_BUILDING)
 #define INDEEP(LOC)  ((LOC) >= LOC_MISTHALL && !OUTSID(LOC))
 #define BUG(x)       bug(x, #x)
 #define INDEEP(LOC)  ((LOC) >= LOC_MISTHALL && !OUTSID(LOC))
 #define BUG(x)       bug(x, #x)
+
 #define MOTION_WORD(n)  ((n) + 0)
 #define OBJECT_WORD(n)  ((n) + 1000)
 #define ACTION_WORD(n)  ((n) + 2000)
 #define MOTION_WORD(n)  ((n) + 0)
 #define OBJECT_WORD(n)  ((n) + 1000)
 #define ACTION_WORD(n)  ((n) + 2000)
diff --git a/misc.c b/misc.c
index e9d833e30ef3d547bd741ff927f4fba104282316..78cc5a30e5a13a5da4f68519e77bb1a30a52ee6b 100644 (file)
--- a/misc.c
+++ b/misc.c
@@ -171,8 +171,17 @@ void vspeak(const char* msg, bool blank, va_list ap)
     long previous_arg = 0;
     for (int i = 0; i < msglen; i++) {
         if (msg[i] != '%') {
     long previous_arg = 0;
     for (int i = 0; i < msglen; i++) {
         if (msg[i] != '%') {
-            *renderp++ = msg[i];
-            size--;
+           /* Ugh.  Least obtrusive way to deal with artifacts "on the floor"
+            * being dropped outside of both cave and building. */
+           if (strncmp(msg + i, "floor", 5) == 0 && strchr(" .", msg[i+5]) && !INSIDE(game.loc)) {
+               strcpy(renderp, "ground");
+               renderp += 6;
+               i += 4;
+               size -= 5;
+           } else {
+               *renderp++ = msg[i];
+               size--;
+           }
         } else {
             long arg = va_arg(ap, long);
             if (arg == -1)
         } else {
             long arg = va_arg(ap, long);
             if (arg == -1)
index d06f170f7661d60b96f34e618bfe7980245684ec..5994b54e80de547aaec85fdda492571e4b0f9b98 100644 (file)
@@ -58,6 +58,9 @@ Bug fixes:
   incorrect most places it appeared and has been replaced by "A crystal 
   bridge spans the fissure." (timeless present).
 
   incorrect most places it appeared and has been replaced by "A crystal 
   bridge spans the fissure." (timeless present).
 
+* Under odd circumstances (dropping rug or vase outdoors) the game could
+  say "floor" when it should say "ground" (or "dirt", or something).
+
 By default, advent issues "> " as a command prompt.  This feature
 became common in many variants after the original 350-point version,
 but was never backported into Crowther & Woods's main line before now.
 By default, advent issues "> " as a command prompt.  This feature
 became common in many variants after the original 350-point version,
 but was never backported into Crowther & Woods's main line before now.
index e473dbefa11691b0a72ac40793f4969f16806fea..51e9b529d1670036e6a3d81678275ab4bbee601d 100644 (file)
@@ -1454,9 +1454,9 @@ long description of your location.
 You are in a valley in the forest beside a stream tumbling along a
 rocky bed.
 
 You are in a valley in the forest beside a stream tumbling along a
 rocky bed.
 
-The floor is littered with worthless shards of pottery.
+The ground is littered with worthless shards of pottery.
 
 
-A small velvet pillow lies on the floor.
+A small velvet pillow lies on the ground.
 
 > take vase
 
 
 > take vase