Changeset - r9373:22aab9ac3735
[Not reviewed]
master
0 4 0
rubidium - 16 years ago 2008-05-26 21:38:17
rubidium@openttd.org
(svn r13277) -Fix: opntitle 'jumping' to the temperate climate when closing the NewGRF settings window.
4 files changed with 8 insertions and 19 deletions:
0 comments (0 inline, 0 general)
src/genworld_gui.cpp
Show inline comments
 
@@ -205,7 +205,7 @@ void StartGeneratingLandscape(glwp_modes
 
	DeleteAllNonVitalWindows();
 

	
 
	/* Copy all XXX_newgame to XXX when coming from outside the editor */
 
	UpdatePatches();
 
	_settings = _settings_newgame;
 
	ResetGRFConfig(true);
 

	
 
	SndPlayFx(SND_15_BEEP);
 
@@ -377,7 +377,7 @@ struct GenerateLandscapeWindow : public 
 
				break;
 

	
 
			case GLAND_GENERATE_BUTTON: // Generate
 
				UpdatePatches();
 
				_settings = _settings_newgame;
 

	
 
				if (_settings.economy.town_layout == TL_NO_ROADS) {
 
					ShowQuery(
src/openttd.cpp
Show inline comments
 
@@ -588,10 +588,8 @@ int ttd_main(int argc, char *argv[])
 
	/* XXX - ugly hack, if diff_level is 9, it means we got no setting from the config file */
 
	if (_settings_newgame.difficulty.diff_level == 9) SetDifficultyLevel(0, &_settings_newgame.difficulty);
 

	
 
	/* Make sure _patches is filled with _patches_newgame if we switch to a game directly */
 
	if (_switch_mode != SM_NONE) {
 
		UpdatePatches();
 
	}
 
	/* Make sure _settings is filled with _settings_newgame if we switch to a game directly */
 
	if (_switch_mode != SM_NONE) _settings = _settings_newgame;
 

	
 
	/* initialize the ingame console */
 
	IConsoleInit();
 
@@ -1916,8 +1914,6 @@ bool AfterLoadGame()
 
		}
 
	}
 

	
 
	if (CheckSavegameVersion(22))  UpdatePatches();
 

	
 
	if (CheckSavegameVersion(25)) {
 
		Vehicle *v;
 
		FOR_ALL_VEHICLES(v) {
src/settings.cpp
Show inline comments
 
@@ -2265,22 +2265,16 @@ static void Save_PATS()
 

	
 
void CheckConfig()
 
{
 
	// Increase old default values for pf_maxdepth and pf_maxlength
 
	// to support big networks.
 
	/*
 
	 * Increase old default values for pf_maxdepth and pf_maxlength
 
	 * to support big networks.
 
	 */
 
	if (_settings_newgame.pf.opf.pf_maxdepth == 16 && _settings_newgame.pf.opf.pf_maxlength == 512) {
 
		_settings_newgame.pf.opf.pf_maxdepth = 48;
 
		_settings_newgame.pf.opf.pf_maxlength = 4096;
 
	}
 
}
 

	
 
void UpdatePatches()
 
{
 
	/* Since old(er) savegames don't have any patches saved, we initialise
 
	 * them with the default values just as it was in the old days.
 
	 * Also new games need this copying-over */
 
	_settings = _settings_newgame; /* backwards compatibility */
 
}
 

	
 
extern const ChunkHandler _setting_chunk_handlers[] = {
 
	{ 'OPTS', NULL,      Load_OPTS, CH_RIFF},
 
	{ 'PATS', Save_PATS, Load_PATS, CH_RIFF | CH_LAST},
src/settings_func.h
Show inline comments
 
@@ -12,6 +12,5 @@ void IConsoleListPatches();
 
void LoadFromConfig();
 
void SaveToConfig();
 
void CheckConfig();
 
void UpdatePatches();
 

	
 
#endif /* SETTINGS_FUNC_H */
0 comments (0 inline, 0 general)