(svn r2005) - Fix: fix previous commit. Using 'New Game (scenario)' will use YOUR difficulty settings but ingame options (eg townnames, currency). Also settings are correctly saved when closing the difficulty window now.
authorDarkvater
Sun, 13 Mar 2005 11:47:04 +0000
changeset 1501 0faec0f792b0
parent 1500 228f77e88adf
child 1502 e84925444095
(svn r2005) - Fix: fix previous commit. Using 'New Game (scenario)' will use YOUR difficulty settings but ingame options (eg townnames, currency). Also settings are correctly saved when closing the difficulty window now.
settings_gui.c
ttd.c
--- a/settings_gui.c	Sat Mar 12 21:21:47 2005 +0000
+++ b/settings_gui.c	Sun Mar 13 11:47:04 2005 +0000
@@ -483,7 +483,7 @@
 			for (btn = 0; btn != GAME_DIFFICULTY_NUM; btn++) {
 				val = ((int*)&_opt_mod_temp.diff)[btn];
 				// if setting has changed, change it
-				if (val != ((int*)&_opt_mod_temp.diff)[btn])
+				if (val != ((int*)&_opt_ptr->diff)[btn])
 					DoCommandP(0, btn, val, NULL, CMD_CHANGE_DIFFICULTY_LEVEL);
 			}
 			DoCommandP(0, -1, _opt_mod_temp.diff_level, NULL, CMD_CHANGE_DIFFICULTY_LEVEL);
--- a/ttd.c	Sat Mar 12 21:21:47 2005 +0000
+++ b/ttd.c	Sun Mar 13 11:47:04 2005 +0000
@@ -789,8 +789,7 @@
 /**
  * Start Scenario starts a new game based on a scenario.
  * Eg 'New Game' --> select a preset scenario
- * This starts a scenario based on your current difficulty settings just
- * fix the landscape as that can be different from what is selected in the intro
+ * This starts a scenario based on your current difficulty settings
  */
 static void StartScenario(void)
 {
@@ -818,12 +817,9 @@
 		ShowErrorMessage(_error_message, STR_4009_GAME_LOAD_FAILED, 0, 0);
 	}
 
-	{
-		byte landscape = _opt.landscape; // backup loaded landscape;
-		_opt_ptr = &_opt;
-		memcpy(_opt_ptr, &_opt_newgame, sizeof(GameOptions));
-		_opt_ptr->landscape = landscape;
-	}
+	_opt_ptr = &_opt;
+	memcpy(&_opt_ptr->diff, &_opt_newgame.diff, sizeof(GameDifficulty));
+	_opt.diff_level = _opt_newgame.diff_level;
 
 	// Inititalize data
 	StartupPlayers();