Added some assertions to help diagnose bug #5597. Added Auto-saves

This commit is contained in:
Dave White 2003-09-27 22:55:53 +00:00
parent 5568cf8f89
commit 206f3b89a2
3 changed files with 7 additions and 0 deletions

View file

@ -99,6 +99,7 @@ lawful=Lawful
neutral=Neutral
chaotic=Chaotic
auto_save="Auto-Save"
save_replay_message="Do you want to save a replay of this scenario?"
save_game_message="Do you want to save your game?"
save_game_label="Name:"

View file

@ -18,6 +18,7 @@
#include "unit_types.hpp"
#include <algorithm>
#include <cassert>
#include <cmath>
#include <iostream>
#include <map>
@ -134,6 +135,8 @@ paths::route a_star_search(const gamemap::location& src,
rt.steps.push_back(dst);
rt.move_left = int(lowest->f);
assert(rt.steps.front() == src);
std::cout << "exiting a* search (solved)\n";
return rt;

View file

@ -98,6 +98,8 @@ void play_turn(game_data& gameinfo, game_state& state_of_game,
if(route.steps.empty())
continue;
assert(route.steps.front() == *g);
gui.set_route(&route);
const size_t moves =
move_unit(&gui,map,units,teams,route.steps,&recorder,&undo_stack);
@ -407,6 +409,7 @@ void play_turn(game_data& gameinfo, game_state& state_of_game,
}
else if(result == string_table["end_turn"]) {
recorder.save_game(gameinfo,string_table["auto_save"]);
recorder.end_turn();
return;
}