From 37cc3eeaba7809f4b3382f4a6aaf4fe2a914cd68 Mon Sep 17 00:00:00 2001 From: "John \"Elwin\" Edwards" Date: Thu, 28 May 2015 11:08:03 -0400 Subject: [PATCH] arogue7, xrogue: fix command repetition. In both games, command() loops and calls the action function twice for each command: once to schedule it by setting player.t_action and player.t_no_move, and again, to actually do it, once player.t_no_move has been reduced to 0. Each loop decremented count, so repeated commands were only repeated half the number of times the player typed. count is now decremented only when ch has been set to the repeated command. --- arogue7/command.c | 2 +- xrogue/command.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arogue7/command.c b/arogue7/command.c index c98969f..12ddd5b 100644 --- a/arogue7/command.c +++ b/arogue7/command.c @@ -192,7 +192,7 @@ command() /* * execute a command */ - if (count && !running) + if (count && !running && player.t_action == A_NIL) count--; switch (ch) { case '!' : shell(); diff --git a/xrogue/command.c b/xrogue/command.c index d83a9a6..228dd18 100644 --- a/xrogue/command.c +++ b/xrogue/command.c @@ -185,7 +185,7 @@ command() /* * execute a command */ - if (count && !running) + if (count && !running && player.t_action == A_NIL) count--; switch (ch) {