X-Git-Url: https://jxself.org/git/?p=open-adventure.git;a=blobdiff_plain;f=main.c;h=a57694e3fb110e5e01a1ee73ae90d3cb85de9375;hp=9cb04979b92f68be6b9a0a908837a03856776fc8;hb=0468da2cdf37b2f424a68c859ac88c31d67534a2;hpb=8b1533db1a9d9af1801221d8b31bb5a700ae928d diff --git a/main.c b/main.c index 9cb0497..a57694e 100644 --- a/main.c +++ b/main.c @@ -1060,13 +1060,17 @@ Lclearobj: #ifdef GDEBUG /* Needs to stay synced with enum word_type_t */ - const char *types[] = {"NO_WORD_TYPE", "MOTION", "OBJECT", "ACTION", "NUMERIC"}; - printf("Preserve: type1 = %s, id1 = %ld, type2 = %s, id2 = %ld\n", + 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: type1 = %s, id1 = %ld, type2 = %s, id2 = %ld\n", + 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], @@ -1117,17 +1121,16 @@ Lclearobj: command.word[0].id = ENTRANCE; } } - if (!((command.word[0].id != WATER && command.word[0].id != OIL) || (command.word[1].id != PLANT && command.word[1].id != DOOR))) { + if ((command.word[0].id == WATER || command.word[0].id == OIL) && (command.word[1].id == PLANT || command.word[1].id == DOOR)) { if (AT(command.word[1].id)) { command.word[1].id = POUR; command.word[1].type = ACTION; - strncpy(command.word[1].raw, "POUR", LINESIZE - 1); + strncpy(command.word[1].raw, "pour", LINESIZE - 1); } } if (command.word[0].id == CAGE && command.word[1].id == BIRD && HERE(CAGE) && HERE(BIRD)) { command.word[0].id = CARRY; command.word[0].type = ACTION; - strncpy(command.word[1].raw, "CATCH", LINESIZE - 1); } } @@ -1175,6 +1178,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;