(svn r13255) -Codechange: move _opt to _settings.

This commit is contained in:
rubidium
2008-05-25 22:36:44 +00:00
parent 8d60206684
commit d289464d69
49 changed files with 344 additions and 360 deletions

View File

@@ -184,8 +184,8 @@ void AI_RunGameLoop()
_ai.tick++;
/* Make sure the AI follows the difficulty rule.. */
assert(_opt.diff.competitor_speed <= 4);
if ((_ai.tick & ((1 << (4 - _opt.diff.competitor_speed)) - 1)) != 0) return;
assert(_settings.difficulty.competitor_speed <= 4);
if ((_ai.tick & ((1 << (4 - _settings.difficulty.competitor_speed)) - 1)) != 0) return;
/* Check for AI-client (so joining a network with an AI) */
if (!_networking || _network_server) {

View File

@@ -2550,7 +2550,7 @@ handle_nocash:
bool is_pass = (
_players_ai[p->index].cargo_type == CT_PASSENGERS ||
_players_ai[p->index].cargo_type == CT_MAIL ||
(_opt.landscape == LT_TEMPERATE && _players_ai[p->index].cargo_type == CT_VALUABLES)
(_settings.game_creation.landscape == LT_TEMPERATE && _players_ai[p->index].cargo_type == CT_VALUABLES)
);
Order order;
@@ -3285,7 +3285,7 @@ static void AiStateBuildRoadVehicles(Player *p)
bool is_pass = (
_players_ai[p->index].cargo_type == CT_PASSENGERS ||
_players_ai[p->index].cargo_type == CT_MAIL ||
(_opt.landscape == LT_TEMPERATE && _players_ai[p->index].cargo_type == CT_VALUABLES)
(_settings.game_creation.landscape == LT_TEMPERATE && _players_ai[p->index].cargo_type == CT_VALUABLES)
);
Order order;

View File

@@ -1017,7 +1017,7 @@ static void AiNew_State_BuildPath(Player *p)
if (_players_ainew[p->index].temp == -1) {
DEBUG(ai, 1, "Starting to build new path");
// Init the counter
_players_ainew[p->index].counter = (4 - _opt.diff.competitor_speed) * AI_BUILDPATH_PAUSE + 1;
_players_ainew[p->index].counter = (4 - _settings.difficulty.competitor_speed) * AI_BUILDPATH_PAUSE + 1;
// Set the position to the startingplace (-1 because in a minute we do ++)
_players_ainew[p->index].path_info.position = -1;
// And don't do this again
@@ -1026,7 +1026,7 @@ static void AiNew_State_BuildPath(Player *p)
// Building goes very fast on normal rate, so we are going to slow it down..
// By let the counter count from AI_BUILDPATH_PAUSE to 0, we have a nice way :)
if (--_players_ainew[p->index].counter != 0) return;
_players_ainew[p->index].counter = (4 - _opt.diff.competitor_speed) * AI_BUILDPATH_PAUSE + 1;
_players_ainew[p->index].counter = (4 - _settings.difficulty.competitor_speed) * AI_BUILDPATH_PAUSE + 1;
// Increase the building position
_players_ainew[p->index].path_info.position++;