record and replay repeating spellcast
This commit is contained in:
@@ -251,9 +251,17 @@ bool prime_time() {
|
||||
|
||||
void handle_spellcast(eSkill which_type, bool& did_something, bool& need_redraw, bool& need_reprint, bool record) {
|
||||
if(record && recording){
|
||||
std::map<std::string,std::string> info;
|
||||
|
||||
std::ostringstream sstr;
|
||||
sstr << which_type;
|
||||
record_action("handle_spellcast", sstr.str());
|
||||
info["which_type"] = sstr.str();
|
||||
|
||||
sstr.str("");
|
||||
sstr << std::boolalpha << spell_forced;
|
||||
info["spell_forced"] = sstr.str();
|
||||
|
||||
record_action("handle_spellcast", info);
|
||||
}
|
||||
short store_sp[6];
|
||||
extern short spec_target_fail;
|
||||
|
@@ -429,10 +429,24 @@ static void replay_next_action() {
|
||||
eSpell spell_picked = static_cast<eSpell>(std::stoi(next_action.GetText()));
|
||||
handle_menu_spell(spell_picked);
|
||||
}else if(t == "handle_spellcast"){
|
||||
std::istringstream sstr(next_action.GetText());
|
||||
auto info = info_from_action(next_action);
|
||||
std::istringstream sstr(info["which_type"]);
|
||||
eSkill which_type;
|
||||
sstr >> which_type;
|
||||
|
||||
// Incredibly, this code isn't working despite being used as a pattern elsewhere:
|
||||
// sstr.str(info["spell_forced"]);
|
||||
// sstr >> std::boolalpha >> spell_forced;
|
||||
|
||||
// But this code is:
|
||||
if(info["spell_forced"] == "true"){
|
||||
spell_forced = true;
|
||||
}else{
|
||||
spell_forced = false;
|
||||
}
|
||||
|
||||
// If I'm making an obvious error I just can't see it.
|
||||
|
||||
handle_spellcast(which_type, did_something, need_redraw, need_reprint);
|
||||
}else if(t == "handle_target_space"){
|
||||
location destination = location_from_action(next_action);
|
||||
|
Reference in New Issue
Block a user