benchmarking utility command to toggle autosave functionality,
may be removed later
This commit is contained in:
parent
23882ee60f
commit
052bd8dd03
3 changed files with 7 additions and 2 deletions
|
@ -30,7 +30,7 @@ namespace game_config
|
|||
int kill_experience = 8;
|
||||
int leadership_bonus = 25;
|
||||
const std::string version = VERSION;
|
||||
bool debug = false, editor = false, ignore_replay_errors = false, mp_debug = false, exit_at_end = false, no_delay = false;
|
||||
bool debug = false, editor = false, ignore_replay_errors = false, mp_debug = false, exit_at_end = false, no_delay = false, disable_autosave = false;
|
||||
|
||||
std::string game_icon = "wesnoth-icon.png", game_title, game_logo, title_music, anonymous_music,
|
||||
victory_music, defeat_music;
|
||||
|
|
|
@ -33,7 +33,7 @@ namespace game_config
|
|||
extern int leadership_bonus;
|
||||
extern const std::string version;
|
||||
|
||||
extern bool debug, editor, ignore_replay_errors, mp_debug, exit_at_end, no_delay;
|
||||
extern bool debug, editor, ignore_replay_errors, mp_debug, exit_at_end, no_delay, disable_autosave;
|
||||
|
||||
extern std::string path;
|
||||
|
||||
|
|
|
@ -465,6 +465,9 @@ namespace events{
|
|||
|
||||
void menu_handler::autosave(const std::string &label, unsigned turn, const config &starting_pos) const
|
||||
{
|
||||
if(game_config::disable_autosave)
|
||||
return;
|
||||
|
||||
Uint32 start, end;
|
||||
start = SDL_GetTicks();
|
||||
config snapshot;
|
||||
|
@ -1659,6 +1662,8 @@ namespace events{
|
|||
throw end_level_exception(QUIT);
|
||||
} else if(cmd == "ignore_replay_errors") {
|
||||
game_config::ignore_replay_errors = (data != "off") ? true : false;
|
||||
} else if(cmd == "nosaves") {
|
||||
game_config::disable_autosave = (data != "off") ? true : false;
|
||||
} else if(cmd == "n" && game_config::debug) {
|
||||
throw end_level_exception(VICTORY);
|
||||
} else if(cmd == "debug" && network::nconnections() == 0) {
|
||||
|
|
Loading…
Add table
Reference in a new issue