game: set correctly the new file name if a player saves the game after victory

This commit is contained in:
ALONSO Laurent
2022-01-19 10:14:18 +01:00
committed by Celtic Minstrel
parent 5573e4eacd
commit 26a759c1a5
2 changed files with 5 additions and 3 deletions

View File

@@ -981,6 +981,7 @@ static void handle_get_items(bool& did_something, bool& need_redraw, bool& need_
else { else {
j = get_item(univ.current_pc().combat_pos,univ.cur_pc,false); j = get_item(univ.current_pc().combat_pos,univ.cur_pc,false);
take_ap(4); take_ap(4);
pick_next_pc();
} }
if(j > 0) { if(j > 0) {
put_item_screen(stat_window); put_item_screen(stat_window);
@@ -1007,7 +1008,8 @@ static void handle_victory() {
if(cChoiceDlog("congrats-save",{"cancel","save"}).show() == "save"){ if(cChoiceDlog("congrats-save",{"cancel","save"}).show() == "save"){
// TODO: Wait, this shouldn't be a "save as" action, should it? It should save without asking for a location. // TODO: Wait, this shouldn't be a "save as" action, should it? It should save without asking for a location.
fs::path file = nav_put_party(); fs::path file = nav_put_party();
if(!file.empty()) save_party(file, univ); if(!file.empty() && save_party(file, univ))
univ.file = file;
} }
} }

View File

@@ -1130,9 +1130,9 @@ void do_combat_cast(location target) {
} }
else if(dist(caster.combat_pos,target) > current_spell_range) else if(dist(caster.combat_pos,target) > current_spell_range)
add_string_to_buf(" Target out of range."); add_string_to_buf(" Target out of range.");
else if(sight_obscurity(target.x,target.y) == 5 && !allow_obstructed) else if(!allow_obstructed && sight_obscurity(target.x,target.y) == 5)
add_string_to_buf(" Target space obstructed."); add_string_to_buf(" Target space obstructed.");
else if(univ.town.is_antimagic(target.x,target.y) && !allow_antimagic) else if(!allow_antimagic && univ.town.is_antimagic(target.x,target.y))
add_string_to_buf(" Target in antimagic field."); add_string_to_buf(" Target in antimagic field.");
else { else {
failed = false; failed = false;