From 4a4c113624239b55b176ee23ed8e23c2337d42e2 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Wed, 12 Jul 2017 00:19:16 -0400 Subject: [PATCH 1/1] Prevent game from uttering solecisms about the "floor" when outside. --- advent.h | 2 ++ misc.c | 13 +++++++++++-- notes.adoc | 3 +++ tests/fillvase.chk | 4 ++-- 4 files changed, 18 insertions(+), 4 deletions(-) diff --git a/advent.h b/advent.h index 3015d65..44839a8 100644 --- a/advent.h +++ b/advent.h @@ -65,8 +65,10 @@ #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 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 e9d833e..78cc5a3 100644 --- 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] != '%') { - *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) diff --git a/notes.adoc b/notes.adoc index d06f170..5994b54 100644 --- a/notes.adoc +++ b/notes.adoc @@ -58,6 +58,9 @@ Bug fixes: 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. diff --git a/tests/fillvase.chk b/tests/fillvase.chk index e473dbe..51e9b52 100644 --- a/tests/fillvase.chk +++ b/tests/fillvase.chk @@ -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. -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 -- 2.31.1