summaryrefslogtreecommitdiff
path: root/src/ai/default
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2008-05-29 15:13:28 +0000
committerrubidium <rubidium@openttd.org>2008-05-29 15:13:28 +0000
commit923e21129c94c36bb403e955a1f334ef34722e8b (patch)
tree59059f0a1aba0794fa770e8c9a19312e4ce300af /src/ai/default
parent2a816fb685b373e38347f809bcdc7f2fdef0139c (diff)
downloadopenttd-923e21129c94c36bb403e955a1f334ef34722e8b.tar.xz
(svn r13325) -Codechange: split the client-side only settings from the settings stored in the savegame so there is no need to have a duplicate copy of it for new games.
Diffstat (limited to 'src/ai/default')
-rw-r--r--src/ai/default/default.cpp26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/ai/default/default.cpp b/src/ai/default/default.cpp
index 14fc43392..1e5fcbcb8 100644
--- a/src/ai/default/default.cpp
+++ b/src/ai/default/default.cpp
@@ -1570,21 +1570,21 @@ static void AiStateWantNewRoute(Player *p)
for (;;) {
r = (uint16)Random();
- if (_settings.ai.ai_disable_veh_train &&
- _settings.ai.ai_disable_veh_roadveh &&
- _settings.ai.ai_disable_veh_aircraft &&
- _settings.ai.ai_disable_veh_ship) {
+ if (_settings_game.ai.ai_disable_veh_train &&
+ _settings_game.ai.ai_disable_veh_roadveh &&
+ _settings_game.ai.ai_disable_veh_aircraft &&
+ _settings_game.ai.ai_disable_veh_ship) {
return;
}
if (r < 0x7626) {
- if (_settings.ai.ai_disable_veh_train) continue;
+ if (_settings_game.ai.ai_disable_veh_train) continue;
AiWantTrainRoute(p);
} else if (r < 0xC4EA) {
- if (_settings.ai.ai_disable_veh_roadveh) continue;
+ if (_settings_game.ai.ai_disable_veh_roadveh) continue;
AiWantRoadRoute(p);
} else if (r < 0xD89B) {
- if (_settings.ai.ai_disable_veh_aircraft) continue;
+ if (_settings_game.ai.ai_disable_veh_aircraft) continue;
AiWantAircraftRoute(p);
} else {
/* Ships are not implemented in this (broken) AI */
@@ -1603,7 +1603,7 @@ static void AiStateWantNewRoute(Player *p)
static bool AiCheckTrackResources(TileIndex tile, const AiDefaultBlockData *p, byte cargo)
{
- uint rad = (_settings.station.modified_catchment) ? CA_TRAIN : CA_UNMODIFIED;
+ uint rad = (_settings_game.station.modified_catchment) ? CA_TRAIN : CA_UNMODIFIED;
for (; p->mode != 4; p++) {
AcceptedCargo values;
@@ -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 ||
- (_settings.game_creation.landscape == LT_TEMPERATE && _players_ai[p->index].cargo_type == CT_VALUABLES)
+ (_settings_game.game_creation.landscape == LT_TEMPERATE && _players_ai[p->index].cargo_type == CT_VALUABLES)
);
Order order;
@@ -2599,7 +2599,7 @@ static bool AiCheckRoadResources(TileIndex tile, const AiDefaultBlockData *p, by
uint values[NUM_CARGO];
int rad;
- if (_settings.station.modified_catchment) {
+ if (_settings_game.station.modified_catchment) {
rad = CA_TRUCK; // Same as CA_BUS at the moment?
} else { // change that at some point?
rad = 4;
@@ -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 ||
- (_settings.game_creation.landscape == LT_TEMPERATE && _players_ai[p->index].cargo_type == CT_VALUABLES)
+ (_settings_game.game_creation.landscape == LT_TEMPERATE && _players_ai[p->index].cargo_type == CT_VALUABLES)
);
Order order;
@@ -3423,7 +3423,7 @@ static bool AiCheckAirportResources(TileIndex tile, const AiDefaultBlockData *p,
const AirportFTAClass* airport = GetAirport(p->attr);
uint w = airport->size_x;
uint h = airport->size_y;
- uint rad = _settings.station.modified_catchment ? airport->catchment : (uint)CA_UNMODIFIED;
+ uint rad = _settings_game.station.modified_catchment ? airport->catchment : (uint)CA_UNMODIFIED;
if (cargo & 0x80) {
GetProductionAroundTiles(values, tile2, w, h, rad);
@@ -3975,7 +3975,7 @@ void AiDoGameLoop(Player *p)
// to the patch-setting
// Also, it takes into account the setting if the service-interval is in days
// or in %
- _ai_service_interval = _settings.vehicle.servint_ispercent ? 80 : 180;
+ _ai_service_interval = _settings_game.vehicle.servint_ispercent ? 80 : 180;
if (IsHumanPlayer(_current_player)) return;