X-Git-Url: https://jxself.org/git/?a=blobdiff_plain;f=misc.c;h=ee2ac25cd95a90a07b559548240959359f7391bd;hb=ef100a31024414fba31e8e3df899d22aa8d759bf;hp=26bb3325fce1b5a3402beaca1566da5cf47563e0;hpb=fd02259c7f5d3b0fb245575981031a63bfb8b6de;p=open-adventure.git diff --git a/misc.c b/misc.c index 26bb332..ee2ac25 100644 --- a/misc.c +++ b/misc.c @@ -250,7 +250,7 @@ char* get_input() return (input); } -bool YES(vocab_t question, vocab_t yes_response, vocab_t no_response) +bool YES(const char* question, const char* yes_response, const char* no_response) /* Print message X, wait for yes/no answer. If yes, print Y and return true; * if no, print Z and return false. */ { @@ -258,7 +258,7 @@ bool YES(vocab_t question, vocab_t yes_response, vocab_t no_response) bool outcome; for (;;) { - RSPEAK(question); + speak(question); reply = get_input(); @@ -276,11 +276,11 @@ bool YES(vocab_t question, vocab_t yes_response, vocab_t no_response) free(firstword); if (yes == 0 || y == 0) { - RSPEAK(yes_response); + speak(yes_response); outcome = true; break; } else if (no == 0 || n == 0) { - RSPEAK(no_response); + speak(no_response); outcome = false; break; } else @@ -417,7 +417,7 @@ void MOVE(long object, long where) from = game.fixed[object - NOBJECTS]; else from = game.place[object]; - if (from != NOWHERE && from != CARRIED && !SPECIAL(from)) + if (from != LOC_NOWHERE && from != CARRIED && !SPECIAL(from)) CARRY(object, from); DROP(object, where); } @@ -658,4 +658,10 @@ void DATIME(long* d, long* t) *t = (long) tv.tv_usec; } +void bug(enum bugtype num, const char *error_string) +{ + fprintf(stderr, "Fatal error %d, %s.\n", num, error_string); + exit(EXIT_FAILURE); +} + /* end */