Fix GitLab issue #69: repeated knive caveat message
[open-adventure.git] / main.c
diff --git a/main.c b/main.c
index 7f5d8a1f8b9b979d01a20097d3c0e720d7ea954c..6d904f297734fe78e1f27d334d596769d8cdbb51 100644 (file)
--- a/main.c
+++ b/main.c
@@ -1280,11 +1280,13 @@ static bool do_command(void) {
                                }
                        }
 
-                       /* Check to see if the room is dark. If the knife is
-                        * here, and it's dark, the knife permanently disappears
-                        */
+                       /* Check to see if the room is dark. */
                        game.wzdark = DARK(game.loc);
-                       if (game.knfloc != LOC_NOWHERE &&
+                    
+                       /* If the knife is not here it permanently disappears.
+                       * Possibly this should fire if the knife is here but
+                       * the room is dark? */
+                       if (game.knfloc > LOC_NOWHERE &&
                            game.knfloc != game.loc) {
                                game.knfloc = LOC_NOWHERE;
                        }