record/replay giving items

This commit is contained in:
2024-07-31 18:21:15 -05:00
committed by Celtic Minstrel
parent f3f1124bef
commit 27db98a634
2 changed files with 9 additions and 1 deletions

View File

@@ -820,7 +820,11 @@ void handle_use_item(short item_hit, bool& did_something, bool& need_redraw) {
need_redraw = true; 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()) { if(!prime_time()) {
add_string_to_buf("Give item: Finish what you're doing first."); add_string_to_buf("Give item: Finish what you're doing first.");
return; return;

View File

@@ -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_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(short item_hit, bool& need_redraw);
void handle_drop_item(location destination, 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__ #ifdef __APPLE__
eMenuChoice menuChoice=eMenuChoice::MENU_CHOICE_NONE; eMenuChoice menuChoice=eMenuChoice::MENU_CHOICE_NONE;
@@ -315,6 +316,9 @@ void replay_next_action() {
}else if(t == "handle_drop_item_location"){ }else if(t == "handle_drop_item_location"){
location destination = location_from_action(next_action); location destination = location_from_action(next_action);
handle_drop_item(destination, need_redraw); 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); advance_time(did_something, need_redraw, need_reprint);