Prevent game from uttering solecisms about the "floor" when outside.

This commit is contained in:
Eric S. Raymond 2017-07-12 00:19:16 -04:00
parent bd1b893263
commit 4a4c113624
4 changed files with 18 additions and 4 deletions

View file

@ -65,8 +65,10 @@
#define GSTONE(OBJ) ((OBJ) == EMERALD || (OBJ) == RUBY || (OBJ) == AMBER || (OBJ) == SAPPH) #define GSTONE(OBJ) ((OBJ) == EMERALD || (OBJ) == RUBY || (OBJ) == AMBER || (OBJ) == SAPPH)
#define FOREST(LOC) CNDBIT(LOC, COND_FOREST) #define FOREST(LOC) CNDBIT(LOC, COND_FOREST)
#define OUTSID(LOC) (CNDBIT(LOC, COND_ABOVE) || FOREST(LOC)) #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 INDEEP(LOC) ((LOC) >= LOC_MISTHALL && !OUTSID(LOC))
#define BUG(x) bug(x, #x) #define BUG(x) bug(x, #x)
#define MOTION_WORD(n) ((n) + 0) #define MOTION_WORD(n) ((n) + 0)
#define OBJECT_WORD(n) ((n) + 1000) #define OBJECT_WORD(n) ((n) + 1000)
#define ACTION_WORD(n) ((n) + 2000) #define ACTION_WORD(n) ((n) + 2000)

9
misc.c
View file

@ -171,8 +171,17 @@ void vspeak(const char* msg, bool blank, va_list ap)
long previous_arg = 0; long previous_arg = 0;
for (int i = 0; i < msglen; i++) { for (int i = 0; i < msglen; i++) {
if (msg[i] != '%') { if (msg[i] != '%') {
/* 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]; *renderp++ = msg[i];
size--; size--;
}
} else { } else {
long arg = va_arg(ap, long); long arg = va_arg(ap, long);
if (arg == -1) if (arg == -1)

View file

@ -58,6 +58,9 @@ Bug fixes:
incorrect most places it appeared and has been replaced by "A crystal incorrect most places it appeared and has been replaced by "A crystal
bridge spans the fissure." (timeless present). 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 By default, advent issues "> " as a command prompt. This feature
became common in many variants after the original 350-point version, became common in many variants after the original 350-point version,
but was never backported into Crowther & Woods's main line before now. but was never backported into Crowther & Woods's main line before now.

View file

@ -1454,9 +1454,9 @@ long description of your location.
You are in a valley in the forest beside a stream tumbling along a You are in a valley in the forest beside a stream tumbling along a
rocky bed. 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