From 596a15457d897451aa8bfcf64c7c76b09836c01b Mon Sep 17 00:00:00 2001 From: "Jason S. Ninneman" Date: Wed, 12 Jul 2017 13:49:28 -0700 Subject: [PATCH] Dragon attack code no longer edits the command struct. This also fixes a minor bug where refusing to attack the dragon costs the player two turns instead of one. --- actions.c | 13 +++++-------- tests/barehands.chk | 2 +- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/actions.c b/actions.c index 46d09e1..802c1f3 100644 --- a/actions.c +++ b/actions.c @@ -101,14 +101,11 @@ static int attack(struct command_t *command) * fixed), move rug there (not fixed), and move him there, * too. Then do a null motion to get new description. */ rspeak(BARE_HANDS_QUERY); - if (silent_yes()) { - // FIXME: setting wd1 is a workaround for broken logic - command->wd1 = token_to_packed("Y"); - } else { - // FIXME: setting wd1 is a workaround for broken logic - command->wd1 = token_to_packed("N"); - return GO_CHECKFOO; - } + if (!silent_yes()) + { + speak(arbitrary_messages[NASTY_DRAGON]); + return GO_MOVE; + } state_change(DRAGON, DRAGON_DEAD); game.prop[RUG] = RUG_FLOOR; /* Hardcoding LOC_SECRET5 as the dragon's death location is ugly. diff --git a/tests/barehands.chk b/tests/barehands.chk index 1c94758..dad89bc 100644 --- a/tests/barehands.chk +++ b/tests/barehands.chk @@ -307,7 +307,7 @@ The blood-specked body of a huge green dead dragon lies to one side. For crying out loud, the poor thing is already dead! -You scored 77 out of a possible 430, using 50 turns. +You scored 77 out of a possible 430, using 49 turns. Your score qualifies you as a novice class adventurer. -- 2.31.1