More breadcrumb improvements.
[open-adventure.git] / main.c
diff --git a/main.c b/main.c
index 17a5e4371ebdf6a66315b23991d9953669999342..7437c81d61ad6fa7b9056ddadf0ee9506fcc545b 100644 (file)
--- a/main.c
+++ b/main.c
@@ -1059,10 +1059,22 @@ Lclearobj:
             return false;
 
 #ifdef GDEBUG
-       printf("Preserve: type1 = %u, id1 = %ld, type2 = %u, id2 = %ld\n",
-              preserve.word[0].type, preserve.word[0].id, preserve.word[1].type, preserve.word[1].id);
-       printf("Command: type1 = %u, id1 = %ld, type2 = %u, id2 = %ld\n",
-              command.word[0].type, command.word[0].id, command.word[1].type, command.word[1].id);
+       /* Needs to stay synced with enum word_type_t */
+       const char *types[] = {"NO_WORD_TYPE", "MOTION", "OBJECT", "ACTION", "NUMERIC"};
+       /* needs to stay synced with enum speechpart */
+       const char *roles[] = {"unknown", "intransitive", "transitive"};
+       printf("Preserve: role = %s type1 = %s, id1 = %ld, type2 = %s, id2 = %ld\n",
+              roles[preserve.part],
+              types[preserve.word[0].type],
+              preserve.word[0].id,
+              types[preserve.word[1].type],
+              preserve.word[1].id);
+       printf("Command: role = %s type1 = %s, id1 = %ld, type2 = %s, id2 = %ld\n",
+              roles[command.part],
+              types[command.word[0].type],
+              command.word[0].id,
+              types[command.word[1].type],
+              command.word[1].id);
 #endif
 
        /* Handle of objectless action followed by actionless object */
@@ -1167,6 +1179,9 @@ Lookup:
         case GO_TOP:
             continue;  /* back to top of main interpreter loop */
         case GO_WORD2:
+#ifdef GDEBUG
+           printf("Word shift\n");
+#endif /* GDEBUG */
             /* Get second word for analysis. */
            command.word[0] = command.word[1];
            command.word[1] = empty_command_word;