src/players.cpp
changeset 10775 7061477bfbcf
parent 10707 81a4013a7680
child 10784 c3c7b558b4f1
--- a/src/players.cpp	Thu May 29 11:47:56 2008 +0000
+++ b/src/players.cpp	Thu May 29 15:13:28 2008 +0000
@@ -65,9 +65,9 @@
 	/* Do not update the patches if we are in the intro GUI */
 	if (IsValidPlayer(new_player) && _game_mode != GM_MENU) {
 		const Player *p = GetPlayer(new_player);
-		_settings.gui.autorenew        = p->engine_renew;
-		_settings.gui.autorenew_months = p->engine_renew_months;
-		_settings.gui.autorenew_money  = p->engine_renew_money;
+		_settings_client.gui.autorenew        = p->engine_renew;
+		_settings_client.gui.autorenew_months = p->engine_renew_months;
+		_settings_client.gui.autorenew_money  = p->engine_renew_money;
 		InvalidateWindow(WC_GAME_OPTIONS, 0);
 	}
 }
@@ -541,9 +541,9 @@
 	/* Engine renewal settings */
 	p->engine_renew_list = NULL;
 	p->renew_keep_length = false;
-	p->engine_renew = _settings_newgame.gui.autorenew;
-	p->engine_renew_months = _settings_newgame.gui.autorenew_months;
-	p->engine_renew_money = _settings_newgame.gui.autorenew_money;
+	p->engine_renew = _settings_client.gui.autorenew;
+	p->engine_renew_months = _settings_client.gui.autorenew_months;
+	p->engine_renew_money = _settings_client.gui.autorenew_money;
 
 	GeneratePresidentName(p);
 
@@ -563,7 +563,7 @@
 void StartupPlayers()
 {
 	/* The AI starts like in the setting with +2 month max */
-	_next_competitor_start = _settings.difficulty.competitor_start_time * 90 * DAY_TICKS + RandomRange(60 * DAY_TICKS) + 1;
+	_next_competitor_start = _settings_game.difficulty.competitor_start_time * 90 * DAY_TICKS + RandomRange(60 * DAY_TICKS) + 1;
 }
 
 static void MaybeStartNewPlayer()
@@ -578,10 +578,10 @@
 	}
 
 	/* when there's a lot of computers in game, the probability that a new one starts is lower */
-	if (n < (uint)_settings.difficulty.max_no_competitors &&
+	if (n < (uint)_settings_game.difficulty.max_no_competitors &&
 			n < (_network_server ?
-				InteractiveRandomRange(_settings.difficulty.max_no_competitors + 2) :
-				RandomRange(_settings.difficulty.max_no_competitors + 2)
+				InteractiveRandomRange(_settings_game.difficulty.max_no_competitors + 2) :
+				RandomRange(_settings_game.difficulty.max_no_competitors + 2)
 			)) {
 		/* Send a command to all clients to start up a new AI.
 		 * Works fine for Multiplayer and Singleplayer */
@@ -589,7 +589,7 @@
 	}
 
 	/* The next AI starts like the difficulty setting said, with +2 month max */
-	_next_competitor_start = _settings.difficulty.competitor_start_time * 90 * DAY_TICKS + 1;
+	_next_competitor_start = _settings_game.difficulty.competitor_start_time * 90 * DAY_TICKS + 1;
 	_next_competitor_start += _network_server ? InteractiveRandomRange(60 * DAY_TICKS) : RandomRange(60 * DAY_TICKS);
 }
 
@@ -630,7 +630,7 @@
 		}
 	}
 
-	if (_settings.gui.show_finances && _local_player != PLAYER_SPECTATOR) {
+	if (_settings_client.gui.show_finances && _local_player != PLAYER_SPECTATOR) {
 		ShowPlayerFinances(_local_player);
 		p = GetPlayer(_local_player);
 		if (p->num_valid_stat_ent > 5 && p->old_economy[0].performance_history < p->old_economy[4].performance_history) {
@@ -695,7 +695,7 @@
 			if (flags & DC_EXEC) {
 				p->engine_renew = HasBit(p2, 0);
 				if (IsLocalPlayer()) {
-					_settings.gui.autorenew = p->engine_renew;
+					_settings_client.gui.autorenew = p->engine_renew;
 					InvalidateWindow(WC_GAME_OPTIONS, 0);
 				}
 			}
@@ -708,7 +708,7 @@
 			if (flags & DC_EXEC) {
 				p->engine_renew_months = (int16)p2;
 				if (IsLocalPlayer()) {
-					_settings.gui.autorenew_months = p->engine_renew_months;
+					_settings_client.gui.autorenew_months = p->engine_renew_months;
 					InvalidateWindow(WC_GAME_OPTIONS, 0);
 				}
 			}
@@ -721,7 +721,7 @@
 			if (flags & DC_EXEC) {
 				p->engine_renew_money = p2;
 				if (IsLocalPlayer()) {
-					_settings.gui.autorenew_money = p->engine_renew_money;
+					_settings_client.gui.autorenew_money = p->engine_renew_money;
 					InvalidateWindow(WC_GAME_OPTIONS, 0);
 				}
 			}
@@ -771,9 +771,9 @@
 				p->engine_renew_money = p2;
 
 				if (IsLocalPlayer()) {
-					_settings.gui.autorenew = p->engine_renew;
-					_settings.gui.autorenew_months = p->engine_renew_months;
-					_settings.gui.autorenew_money = p->engine_renew_money;
+					_settings_client.gui.autorenew = p->engine_renew;
+					_settings_client.gui.autorenew_months = p->engine_renew_months;
+					_settings_client.gui.autorenew_money = p->engine_renew_money;
 					InvalidateWindow(WC_GAME_OPTIONS, 0);
 				}
 			}
@@ -876,8 +876,8 @@
 		/* Now that we have a new player, broadcast its autorenew settings to
 		 * all clients so everything is in sync */
 		DoCommand(0,
-			(_settings.gui.autorenew << 15 ) | (_settings.gui.autorenew_months << 16) | 4,
-			_settings.gui.autorenew_money,
+			(_settings_client.gui.autorenew << 15 ) | (_settings_client.gui.autorenew_months << 16) | 4,
+			_settings_client.gui.autorenew_money,
 			DC_EXEC,
 			CMD_SET_AUTOREPLACE
 		);
@@ -994,7 +994,7 @@
 /** Save the highscore for the player */
 int8 SaveHighScoreValue(const Player *p)
 {
-	HighScore *hs = _highscore_table[_settings.difficulty.diff_level];
+	HighScore *hs = _highscore_table[_settings_game.difficulty.diff_level];
 	uint i;
 	uint16 score = p->old_economy[0].performance_history;
 
@@ -1122,7 +1122,7 @@
 	}
 
 	/* Initialize end of game variable (when to show highscore chart) */
-	_settings.gui.ending_year = 2051;
+	_settings_client.gui.ending_year = 2051;
 }
 
 /* Save/load of players */