Changeset - r28656:29f31f80076a
[Not reviewed]
master
0 3 0
Patric Stout - 3 months ago 2024-02-03 10:19:47
truebrain@openttd.org
Change: "restart" now uses your newgame settings, where "reload" uses the current settings (#11962)
3 files changed with 8 insertions and 14 deletions:
0 comments (0 inline, 0 general)
src/console_cmds.cpp
Show inline comments
 
@@ -1217,17 +1217,13 @@ DEF_CONSOLE_CMD(ConRestart)
 
{
 
	if (argc == 0) {
 
		IConsolePrint(CC_HELP, "Restart game. Usage: 'restart'.");
 
		IConsolePrint(CC_HELP, "Restarts a game. It tries to reproduce the exact same map as the game started with.");
 
		IConsolePrint(CC_HELP, "However:");
 
		IConsolePrint(CC_HELP, " * restarting games started in another version might create another map due to difference in map generation.");
 
		IConsolePrint(CC_HELP, " * restarting games based on scenarios, loaded games or heightmaps will start a new game based on the settings stored in the scenario/savegame.");
 
		IConsolePrint(CC_HELP, "Restarts a game, using the newgame settings.");
 
		IConsolePrint(CC_HELP, " * if you started from a new game, and your newgame settings haven't changed, the game will be identical to when you started it.");
 
		IConsolePrint(CC_HELP, " * if you started from a savegame / scenario / heightmap, the game might be different, because your settings might differ.");
 
		return true;
 
	}
 

	
 
	/* Don't copy the _newgame pointers to the real pointers, so call SwitchToMode directly */
 
	_settings_game.game_creation.map_x = Map::LogX();
 
	_settings_game.game_creation.map_y = Map::LogY();
 
	_switch_mode = SM_RESTARTGAME;
 
	StartNewGameWithoutGUI(_settings_game.game_creation.generation_seed);
 
	return true;
 
}
 

	
 
@@ -1236,12 +1232,12 @@ DEF_CONSOLE_CMD(ConReload)
 
	if (argc == 0) {
 
		IConsolePrint(CC_HELP, "Reload game. Usage: 'reload'.");
 
		IConsolePrint(CC_HELP, "Reloads a game.");
 
		IConsolePrint(CC_HELP, " * if you started from a savegame / scenario / heightmap, that exact same savegame / scenario / heightmap will be loaded.");
 
		IConsolePrint(CC_HELP, " * if you started from a new game, this acts the same as 'restart'.");
 
		IConsolePrint(CC_HELP, " * if you started from a new game, reload the game with the current active settings.");
 
		IConsolePrint(CC_HELP, " * if you started from a savegame / scenario / heightmap, that same savegame / scenario / heightmap will be loaded again.");
 
		return true;
 
	}
 

	
 
	/* Don't copy the _newgame pointers to the real pointers, so call SwitchToMode directly */
 
	/* Use a switch-mode to prevent copying over newgame settings to active settings. */
 
	_settings_game.game_creation.map_x = Map::LogX();
 
	_settings_game.game_creation.map_y = Map::LogY();
 
	_switch_mode = SM_RELOADGAME;
src/openttd.cpp
Show inline comments
 
@@ -1049,7 +1049,7 @@ void SwitchToMode(SwitchMode new_mode)
 
	if (new_mode != SM_SAVE_GAME) {
 
		/* If the network is active, make it not-active */
 
		if (_networking) {
 
			if (_network_server && (new_mode == SM_LOAD_GAME || new_mode == SM_NEWGAME || new_mode == SM_RESTARTGAME)) {
 
			if (_network_server && (new_mode == SM_LOAD_GAME || new_mode == SM_NEWGAME)) {
 
				NetworkReboot();
 
			} else {
 
				NetworkDisconnect();
 
@@ -1113,7 +1113,6 @@ void SwitchToMode(SwitchMode new_mode)
 
			UpdateSocialIntegration(GM_NORMAL);
 
			break;
 

	
 
		case SM_RESTARTGAME: // Restart --> 'Random game' with current settings
 
		case SM_NEWGAME: // New Game --> 'Random game'
 
			MakeNewGame(false, new_mode == SM_NEWGAME);
 
			GenerateSavegameId();
src/openttd.h
Show inline comments
 
@@ -26,7 +26,6 @@ enum GameMode {
 
enum SwitchMode {
 
	SM_NONE,
 
	SM_NEWGAME,           ///< New Game --> 'Random game'.
 
	SM_RESTARTGAME,       ///< Restart --> 'Random game' with current settings.
 
	SM_RELOADGAME,        ///< Reload the savegame / scenario / heightmap you started the game with.
 
	SM_EDITOR,            ///< Switch to scenario editor.
 
	SM_LOAD_GAME,         ///< Load game, Play Scenario.
0 comments (0 inline, 0 general)