diff options
author | Bardur Arantsson <bardur@scientician.net> | 2019-02-15 19:20:26 +0100 |
---|---|---|
committer | Bardur Arantsson <bardur@scientician.net> | 2019-02-15 19:20:26 +0100 |
commit | 810f63ba0c572f9524f2781b5faf3d1dfd1ffde4 (patch) | |
tree | 8a9f370cc6b9c69a719874255acb417ad6e058c5 | |
parent | 6c4aa293e7b7514910dea0572c9e6e4a360284b3 (diff) |
Pass command_cmd explicitly to repeat_check()
-rw-r--r-- | src/dungeon.cc | 2 | ||||
-rw-r--r-- | src/store.cc | 2 | ||||
-rw-r--r-- | src/util.cc | 5 | ||||
-rw-r--r-- | src/util.hpp | 2 |
4 files changed, 7 insertions, 4 deletions
diff --git a/src/dungeon.cc b/src/dungeon.cc index 389aa9a4..ead7390f 100644 --- a/src/dungeon.cc +++ b/src/dungeon.cc @@ -2919,7 +2919,7 @@ static void process_command() char error_m[80]; /* Handle repeating the last command */ - repeat_check(); + repeat_check(&command_cmd); /* Parse the command */ switch (command_cmd) diff --git a/src/store.cc b/src/store.cc index c607b6f2..7f05bcac 100644 --- a/src/store.cc +++ b/src/store.cc @@ -2848,7 +2848,7 @@ static bool store_process_command() bool recreate = false; /* Handle repeating the last command */ - repeat_check(); + repeat_check(&command_cmd); auto ba_ptr = find_store_action(command_cmd); diff --git a/src/util.cc b/src/util.cc index d6dcb239..3e45a65c 100644 --- a/src/util.cc +++ b/src/util.cc @@ -3184,8 +3184,11 @@ bool repeat_pull(int *what) return true; } -void repeat_check() +void repeat_check(s16b *command_ptr) { + assert(command_ptr); + auto &command_cmd = *command_ptr; + /* Ignore some commands */ if (command_cmd == ESCAPE) return; if (command_cmd == ' ') return; diff --git a/src/util.hpp b/src/util.hpp index 54de07ed..e7f0d5e2 100644 --- a/src/util.hpp +++ b/src/util.hpp @@ -82,7 +82,7 @@ timer_type *new_timer(void (*callback)(), s32b delay); int get_keymap_mode(); void repeat_push(int what); bool repeat_pull(int *what); -void repeat_check(); +void repeat_check(s16b *command_cmd); void get_count(int number, int max); bool in_bounds(int y, int x); bool in_bounds2(int y, int x); |