From fd6da1537369ec3dea28ab2efbef628bb634c7e5 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Wed, 21 Jun 2017 16:54:10 -0400 Subject: [PATCH] Fix GitLab issue #13 - The "eat" command exhibits strange behavior The problem wasn't actually with "eat" but with "grate". Processing of any two-word command with an object of "grate", when given at certain locations including the start, inappropriately jumped directly to the movement code (ignoring the verb). There was a similar bug in the ancestral 2.5, though it manifested slightly differently. --- actions.c | 2 -- tests/carrybird.chk | 4 +--- tests/illformed.chk | 10 +++++----- 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/actions.c b/actions.c index caf20ee..6279306 100644 --- a/actions.c +++ b/actions.c @@ -1011,8 +1011,6 @@ int action(FILE *input, struct command_t *command) if (game.loc == LOC_COBBLE || game.loc == LOC_DEBRIS || game.loc == LOC_AWKWARD || game.loc == LOC_BIRD || game.loc == LOC_PITTOP) command->obj = ENTRNC; - if (command->obj != GRATE) - return GO_MOVE; } else if (command->obj == DWARF && ATDWRF(game.loc) > 0) /* FALL THROUGH */; else if ((LIQUID() == command->obj && HERE(BOTTLE)) || command->obj == LIQLOC(game.loc)) diff --git a/tests/carrybird.chk b/tests/carrybird.chk index c345257..c0c133e 100644 --- a/tests/carrybird.chk +++ b/tests/carrybird.chk @@ -47,9 +47,7 @@ A three foot black rod with a rusty star on an end lies nearby. > eat grate -You're in debris room. - -A three foot black rod with a rusty star on an end lies nearby. +Don't be ridiculous! > w diff --git a/tests/illformed.chk b/tests/illformed.chk index 2bfc882..abcfa19 100644 --- a/tests/illformed.chk +++ b/tests/illformed.chk @@ -33,7 +33,7 @@ You're in front of building. > eat grate -You're in front of building. +Don't be ridiculous! > in @@ -109,9 +109,7 @@ You're in front of building. I don't know where the cave is, but hereabouts no stream can run on the surface for long. I would try the stream. -You are standing at the end of a road before a small brick building. -Around you is a forest. A small stream flows out of the building and -down a gully. +You're in front of building. > enter stream @@ -133,7 +131,9 @@ Carry what? I am unsure how you are facing. Use compass points or nearby objects. -You're in front of building. +You are standing at the end of a road before a small brick building. +Around you is a forest. A small stream flows out of the building and +down a gully. > eat -- 2.31.1