From 27db98a6342dd510ee0a2a6c19b4cd67798ca179 Mon Sep 17 00:00:00 2001 From: Nat Quayle Nelson Date: Wed, 31 Jul 2024 18:21:15 -0500 Subject: [PATCH] record/replay giving items --- src/game/boe.actions.cpp | 6 +++++- src/game/boe.main.cpp | 4 ++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/game/boe.actions.cpp b/src/game/boe.actions.cpp index ce7feeae..84eb14ab 100644 --- a/src/game/boe.actions.cpp +++ b/src/game/boe.actions.cpp @@ -820,7 +820,11 @@ void handle_use_item(short item_hit, bool& did_something, bool& need_redraw) { need_redraw = true; } -static void handle_give_item(short item_hit, bool& did_something, bool& need_redraw) { +void handle_give_item(short item_hit, bool& did_something, bool& need_redraw) { + if(recording){ + record_action("handle_give_item", std::to_string(item_hit)); + } + if(!prime_time()) { add_string_to_buf("Give item: Finish what you're doing first."); return; diff --git a/src/game/boe.main.cpp b/src/game/boe.main.cpp index 3e96df2b..da50426f 100644 --- a/src/game/boe.main.cpp +++ b/src/game/boe.main.cpp @@ -132,6 +132,7 @@ void handle_missile(bool& need_redraw, bool& need_reprint); void handle_get_items(bool& did_something, bool& need_redraw, bool& need_reprint); void handle_drop_item(short item_hit, bool& need_redraw); void handle_drop_item(location destination, bool& need_redraw); +void handle_give_item(short item_hit, bool& did_something, bool& need_redraw); #ifdef __APPLE__ eMenuChoice menuChoice=eMenuChoice::MENU_CHOICE_NONE; @@ -315,6 +316,9 @@ void replay_next_action() { }else if(t == "handle_drop_item_location"){ location destination = location_from_action(next_action); handle_drop_item(destination, need_redraw); + }else if(t == "handle_give_item"){ + short item_hit = short_from_action(next_action); + handle_give_item(item_hit, did_something, need_redraw); } advance_time(did_something, need_redraw, need_reprint);