Improved word type checking.
authorEric S. Raymond <esr@thyrsus.com>
Thu, 20 Jul 2017 11:40:19 +0000 (07:40 -0400)
committerEric S. Raymond <esr@thyrsus.com>
Thu, 20 Jul 2017 11:40:19 +0000 (07:40 -0400)
main.c

diff --git a/main.c b/main.c
index 748a18eee24a8d41db938915b6c38436a1db12fc..66f63f993dc32a845689dd817851acd570a9dcb7 100644 (file)
--- a/main.c
+++ b/main.c
@@ -1120,8 +1120,8 @@ Lclearobj:
         } else
             lampcheck();
 
-        if (command.id1 == ENTER && (command.id2 == STREAM ||
-                                     command.id2 == WATER)) {
+        if (command.type1 == MOTION && command.id1 == ENTER
+           && (command.id2 == STREAM || command.id2 == WATER)) {
             if (LIQLOC(game.loc) == WATER)
                 rspeak(FEET_WET);
             else
@@ -1131,7 +1131,8 @@ Lclearobj:
         }
 
        /* Ugly translationms to get around word polyvalence. */
-       if (command.type1 == ACTION && command.id1 == ENTER && command.id2 != WORD_NOT_FOUND && command.id2 != WORD_EMPTY) {
+       if (command.type1 == ACTION && command.id1 == SAY
+               && command.id2 != WORD_NOT_FOUND && command.id2 != WORD_EMPTY) {
             command.id1 = command.id2;
             command.type1 = command.type2;
             strncpy(command.raw1, command.raw2, LINESIZE - 1);