Fix interrupted-magic-words cosmetic bug.

C patch by Torbjörn Andersson.
This commit is contained in:
Eric S. Raymond 2023-03-10 16:43:27 -05:00
parent 3971a61ab0
commit b125fe7b2a
5 changed files with 19 additions and 8 deletions

3
NEWS
View file

@ -1,5 +1,8 @@
= Open Adventure project news =
Repository head::
Commands in magic-word sequence now interrupt it, as in original.
1.14: 2023-03-09::
Added -a option for BBS door systems.
-o reverts to the old message on some failed magic words.

View file

@ -192,11 +192,13 @@ static phase_codes_t bigwords(vocab_t id)
* word we've got. Last word zips the eggs back to the giant room (unless
* already there). */
{
if ((game.foobar == WORD_EMPTY && id == FEE) ||
(game.foobar == FEE && id == FIE) ||
(game.foobar == FIE && id == FOE) ||
(game.foobar == FOE && id == FOO) ||
(game.foobar == FOE && id == FUM)) {
int foobar = abs(game.foobar);
if ((foobar == WORD_EMPTY && id == FEE) ||
(foobar == FEE && id == FIE) ||
(foobar == FIE && id == FOE) ||
(foobar == FOE && id == FOO) ||
(foobar == FOE && id == FUM)) {
game.foobar = id;
if ((id != FOO) && (id != FUM)) {
rspeak(OK_MAN);

6
main.c
View file

@ -1125,6 +1125,12 @@ static bool do_command()
if (!get_command_input(&command))
return false;
/* Every input, check "foobar" flag. If zero, nothing's going
* on. If pos, make neg. If neg, he skipped a word, so make it
* zero.
*/
game.foobar = (game.foobar > WORD_EMPTY) ? -game.foobar : WORD_EMPTY;
++game.turns;
preprocess_command(&command);
}

View file

@ -1688,11 +1688,11 @@ passage leads south, and a low crawl goes east.
> foe
OK
Nothing happens.
> foo
Done!
Nothing happens.
You scored 311 out of a possible 430, using 291 turns.

View file

@ -1,5 +1,5 @@
## Test interpersing commands amidst magic words
# Check for "Done" or "Nothing happens." in game output.
# Check for "Nothing happens." in game output indicatung sequence interrupt.
no
seed 1318612053
e