diff --git a/src/game/boe.actions.cpp b/src/game/boe.actions.cpp index f23d01e0..79e39f66 100644 --- a/src/game/boe.actions.cpp +++ b/src/game/boe.actions.cpp @@ -993,11 +993,7 @@ void handle_alchemy(bool& need_redraw, bool& need_reprint) { else add_string_to_buf("Alchemy: Only in town."); } -void handle_town_wait(bool& need_redraw, bool& need_reprint) { - if(recording){ - record_action("handle_town_wait", ""); - } - +static void handle_town_wait(bool& need_redraw, bool& need_reprint) { std::vector store_hp; sf::Event dummy_evt; need_reprint = true; @@ -1040,6 +1036,22 @@ void handle_town_wait(bool& need_redraw, bool& need_reprint) { put_pc_screen(); } +void handle_wait(bool& did_something, bool& need_redraw, bool& need_reprint) { + if(recording){ + record_action("handle_wait", ""); + } + + if(overall_mode == MODE_TOWN) { + handle_town_wait(need_redraw, need_reprint); + } else if(overall_mode == MODE_COMBAT) { + handle_stand_ready(need_redraw, need_reprint); + advance_time(did_something, need_redraw, need_reprint); + } else if(overall_mode == MODE_OUTDOORS) { + add_string_to_buf("Wait: In town only."); + print_buf(); + } +} + void handle_combat_switch(bool& did_something, bool& need_redraw, bool& need_reprint) { if(recording){ record_action("handle_combat_switch", ""); @@ -2379,16 +2391,7 @@ bool handle_keystroke(const sf::Event& event, cFramerateLimiter& fps_limiter){ break; case 'w': // Wait / delay - if(overall_mode == MODE_TOWN) { - handle_town_wait(need_redraw, need_reprint); - } else if(overall_mode == MODE_COMBAT) { - handle_stand_ready(need_redraw, need_reprint); - advance_time(did_something, need_redraw, need_reprint); - } else if(overall_mode == MODE_OUTDOORS) { - add_string_to_buf("Wait: In town only."); - print_buf(); - return false; - } + handle_wait(did_something, need_redraw, need_reprint); break; case 'd': // Parry diff --git a/src/game/boe.actions.hpp b/src/game/boe.actions.hpp index 8a4a3a1a..7eced2d7 100644 --- a/src/game/boe.actions.hpp +++ b/src/game/boe.actions.hpp @@ -48,7 +48,7 @@ void handle_equip_item(short item_hit, bool& need_redraw); void handle_use_item(short item_hit, bool& did_something, bool& need_redraw); void handle_item_shop_action(short item_hit); void handle_alchemy(bool& need_redraw, bool& need_reprint); -void handle_town_wait(bool& need_redraw, bool& need_reprint); +void handle_wait(bool& did_something, bool& need_redraw, bool& need_reprint); void handle_combat_switch(bool& did_something, bool& need_redraw, bool& need_reprint); void handle_missile(bool& need_redraw, bool& need_reprint); void handle_get_items(bool& did_something, bool& need_redraw, bool& need_reprint); diff --git a/src/game/boe.main.cpp b/src/game/boe.main.cpp index 1c976187..1c2a5d1a 100644 --- a/src/game/boe.main.cpp +++ b/src/game/boe.main.cpp @@ -318,8 +318,8 @@ static void replay_next_action() { handle_item_shop_action(item_hit); }else if(t == "handle_alchemy"){ handle_alchemy(need_redraw, need_reprint); - }else if(t == "handle_town_wait"){ - handle_town_wait(need_redraw, need_reprint); + }else if(t == "handle_wait"){ + handle_wait(did_something, need_redraw, need_reprint); }else if(t == "handle_combat_switch"){ handle_combat_switch(did_something, need_redraw, need_reprint); }else if(t == "handle_missile"){