mirror of https://github.com/OpenTTD/OpenTTD
(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.
parent
010d1a9be3
commit
de47d0935f
|
@ -483,7 +483,7 @@ static void GameDifficultyWndProc(Window *w, WindowEvent *e)
|
||||||
for (btn = 0; btn != GAME_DIFFICULTY_NUM; btn++) {
|
for (btn = 0; btn != GAME_DIFFICULTY_NUM; btn++) {
|
||||||
val = ((int*)&_opt_mod_temp.diff)[btn];
|
val = ((int*)&_opt_mod_temp.diff)[btn];
|
||||||
// if setting has changed, change it
|
// 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, btn, val, NULL, CMD_CHANGE_DIFFICULTY_LEVEL);
|
||||||
}
|
}
|
||||||
DoCommandP(0, -1, _opt_mod_temp.diff_level, NULL, CMD_CHANGE_DIFFICULTY_LEVEL);
|
DoCommandP(0, -1, _opt_mod_temp.diff_level, NULL, CMD_CHANGE_DIFFICULTY_LEVEL);
|
||||||
|
|
12
ttd.c
12
ttd.c
|
@ -789,8 +789,7 @@ void StartupDisasters(void);
|
||||||
/**
|
/**
|
||||||
* Start Scenario starts a new game based on a scenario.
|
* Start Scenario starts a new game based on a scenario.
|
||||||
* Eg 'New Game' --> select a preset scenario
|
* Eg 'New Game' --> select a preset scenario
|
||||||
* This starts a scenario based on your current difficulty settings just
|
* This starts a scenario based on your current difficulty settings
|
||||||
* fix the landscape as that can be different from what is selected in the intro
|
|
||||||
*/
|
*/
|
||||||
static void StartScenario(void)
|
static void StartScenario(void)
|
||||||
{
|
{
|
||||||
|
@ -818,12 +817,9 @@ static void StartScenario(void)
|
||||||
ShowErrorMessage(_error_message, STR_4009_GAME_LOAD_FAILED, 0, 0);
|
ShowErrorMessage(_error_message, STR_4009_GAME_LOAD_FAILED, 0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
_opt_ptr = &_opt;
|
||||||
byte landscape = _opt.landscape; // backup loaded landscape;
|
memcpy(&_opt_ptr->diff, &_opt_newgame.diff, sizeof(GameDifficulty));
|
||||||
_opt_ptr = &_opt;
|
_opt.diff_level = _opt_newgame.diff_level;
|
||||||
memcpy(_opt_ptr, &_opt_newgame, sizeof(GameOptions));
|
|
||||||
_opt_ptr->landscape = landscape;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Inititalize data
|
// Inititalize data
|
||||||
StartupPlayers();
|
StartupPlayers();
|
||||||
|
|
Loading…
Reference in New Issue