spell recording handle multi-target cast early

This commit is contained in:
2024-08-26 21:39:50 -05:00
committed by Celtic Minstrel
parent 31a12cb55d
commit 89f56bfe4a
2 changed files with 19 additions and 2 deletions

View File

@@ -688,9 +688,17 @@ static void handle_talk(location destination, bool& did_something, bool& need_re
void handle_target_space(location destination, bool& did_something, bool& need_redraw, bool& need_reprint) {
if(recording){
std::map<std::string,std::string> info;
std::ostringstream sstr;
sstr << destination;
record_action("handle_target_space", sstr.str());
info["destination"] = sstr.str();
sstr.str("");
sstr << num_targets_left;
info["num_targets_left"] = sstr.str();
record_action("handle_target_space", info);
}
if(overall_mode == MODE_SPELL_TARGET)
do_combat_cast(destination);

View File

@@ -440,7 +440,16 @@ static void replay_next_action() {
handle_spellcast(which_type, did_something, need_redraw, need_reprint);
}else if(t == "handle_target_space"){
location destination = location_from_action(next_action);
auto info = info_from_action(next_action);
std::istringstream sstr(info["destination"]);
location destination;
sstr >> destination;
sstr.str(info["num_targets_left"]);
sstr.seekg(0);
sstr >> num_targets_left;
handle_target_space(destination, did_something, need_redraw, need_reprint);
}