src/players.cpp
branchnoai
changeset 10776 07203fc29812
parent 10740 325e94c419ac
child 10829 8a0ec0f0f928
--- a/src/players.cpp	Thu May 29 12:52:24 2008 +0000
+++ b/src/players.cpp	Thu May 29 15:56:32 2008 +0000
@@ -64,9 +64,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);
 	}
 }
@@ -540,9 +540,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);
 
@@ -561,7 +561,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()
@@ -576,10 +576,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 */
@@ -587,7 +587,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);
 }
 
@@ -628,7 +628,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) {
@@ -693,7 +693,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);
 				}
 			}
@@ -706,7 +706,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);
 				}
 			}
@@ -719,7 +719,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);
 				}
 			}
@@ -769,9 +769,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);
 				}
 			}
@@ -874,8 +874,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 */