1
0
Fork 0

(svn r15495) -Revert (r15383,r15422): Loading NewGRFs depends on correct settings, but the economy can only be started after loading NewGRFs. In short: r15383 causes more problems then it's worth.

release/0.7
yexo 2009-02-14 23:17:32 +00:00
parent a0b57c849e
commit 1f9ec758aa
3 changed files with 9 additions and 11 deletions

View File

@ -284,13 +284,13 @@ void GenerateWorld(GenerateWorldMode mode, uint size_x, uint size_y)
/* Set the date before loading sprites as some newgrfs check it */ /* Set the date before loading sprites as some newgrfs check it */
SetDate(ConvertYMDToDate(_settings_game.game_creation.starting_year, 0, 1)); SetDate(ConvertYMDToDate(_settings_game.game_creation.starting_year, 0, 1));
InitializeGame(_gw.size_x, _gw.size_y, false);
PrepareGenerateWorldProgress();
/* Load the right landscape stuff */ /* Load the right landscape stuff */
GfxLoadSprites(); GfxLoadSprites();
LoadStringWidthTable(); LoadStringWidthTable();
InitializeGame(_gw.size_x, _gw.size_y, false);
PrepareGenerateWorldProgress();
/* Re-init the windowing system */ /* Re-init the windowing system */
ResetWindowSystem(); ResetWindowSystem();

View File

@ -248,8 +248,8 @@ void StartGeneratingLandscape(glwp_modes mode)
{ {
DeleteAllNonVitalWindows(); DeleteAllNonVitalWindows();
/* Copy the settings needed for creating a new map. */ /* Copy all XXX_newgame to XXX when coming from outside the editor */
_settings_game.game_creation = _settings_newgame.game_creation; MakeNewgameSettingsLive();
ResetGRFConfig(true); ResetGRFConfig(true);
SndPlayFx(SND_15_BEEP); SndPlayFx(SND_15_BEEP);
@ -442,6 +442,8 @@ struct GenerateLandscapeWindow : public QueryStringBaseWindow {
break; break;
case GLAND_GENERATE_BUTTON: // Generate case GLAND_GENERATE_BUTTON: // Generate
MakeNewgameSettingsLive();
if (mode == GLWP_HEIGHTMAP && if (mode == GLWP_HEIGHTMAP &&
(this->x * 2 < (1U << _settings_newgame.game_creation.map_x) || (this->x * 2 < (1U << _settings_newgame.game_creation.map_x) ||
this->x / 2 > (1U << _settings_newgame.game_creation.map_x) || this->x / 2 > (1U << _settings_newgame.game_creation.map_x) ||

View File

@ -640,8 +640,8 @@ int ttd_main(int argc, char *argv[])
ResetGRFConfig(false); ResetGRFConfig(false);
/* Copy the settings needed for creating a new map. */ /* Make sure _settings is filled with _settings_newgame if we switch to a game directly */
_settings_game.game_creation = _settings_newgame.game_creation; if (_switch_mode != SM_NONE) MakeNewgameSettingsLive();
/* initialize the ingame console */ /* initialize the ingame console */
IConsoleInit(); IConsoleInit();
@ -649,10 +649,6 @@ int ttd_main(int argc, char *argv[])
InitializeGUI(); InitializeGUI();
IConsoleCmdExec("exec scripts/autoexec.scr 0"); IConsoleCmdExec("exec scripts/autoexec.scr 0");
/* Initialise the sprite/string tables. */
GfxLoadSprites();
LoadStringWidthTable();
GenerateWorld(GW_EMPTY, 64, 64); // Make the viewport initialization happy GenerateWorld(GW_EMPTY, 64, 64); // Make the viewport initialization happy
WaitTillGeneratedWorld(); WaitTillGeneratedWorld();