summaryrefslogtreecommitdiff
path: root/src/ai/trolly
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/trolly
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/trolly')
-rw-r--r--src/ai/trolly/trolly.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/ai/trolly/trolly.cpp b/src/ai/trolly/trolly.cpp
index cb572e486..849afb318 100644
--- a/src/ai/trolly/trolly.cpp
+++ b/src/ai/trolly/trolly.cpp
@@ -130,9 +130,9 @@ static void AiNew_State_WakeUp(Player *p)
// Check all vehicles once in a while
_players_ainew[p->index].action = AI_ACTION_CHECK_ALL_VEHICLES;
_players_ainew[p->index].last_vehiclecheck_date = _date;
- } else if (c < 100 && !_settings.ai.ai_disable_veh_roadveh) {
+ } else if (c < 100 && !_settings_game.ai.ai_disable_veh_roadveh) {
// Do we have any spots for road-vehicles left open?
- if (GetFreeUnitNumber(VEH_ROAD) <= _settings.vehicle.max_roadveh) {
+ if (GetFreeUnitNumber(VEH_ROAD) <= _settings_game.vehicle.max_roadveh) {
if (c < 85) {
_players_ainew[p->index].action = AI_ACTION_TRUCK_ROUTE;
} else {
@@ -140,8 +140,8 @@ static void AiNew_State_WakeUp(Player *p)
}
}
#if 0
- } else if (c < 200 && !_settings.ai.ai_disable_veh_train) {
- if (GetFreeUnitNumber(VEH_TRAIN) <= _settings.vehicle.max_trains) {
+ } else if (c < 200 && !_settings_game.ai.ai_disable_veh_train) {
+ if (GetFreeUnitNumber(VEH_TRAIN) <= _settings_game.vehicle.max_trains) {
_players_ainew[p->index].action = AI_ACTION_TRAIN_ROUTE;
}
#endif
@@ -155,7 +155,7 @@ static void AiNew_State_WakeUp(Player *p)
return;
}
- if (_settings.ai.ai_disable_veh_roadveh && (
+ if (_settings_game.ai.ai_disable_veh_roadveh && (
_players_ainew[p->index].action == AI_ACTION_BUS_ROUTE ||
_players_ainew[p->index].action == AI_ACTION_TRUCK_ROUTE
)) {
@@ -179,7 +179,7 @@ static void AiNew_State_WakeUp(Player *p)
// to build the route anyway..
if (_players_ainew[p->index].action == AI_ACTION_BUS_ROUTE &&
money > AI_MINIMUM_BUS_ROUTE_MONEY) {
- if (GetFreeUnitNumber(VEH_ROAD) > _settings.vehicle.max_roadveh) {
+ if (GetFreeUnitNumber(VEH_ROAD) > _settings_game.vehicle.max_roadveh) {
_players_ainew[p->index].action = AI_ACTION_NONE;
return;
}
@@ -190,7 +190,7 @@ static void AiNew_State_WakeUp(Player *p)
}
if (_players_ainew[p->index].action == AI_ACTION_TRUCK_ROUTE &&
money > AI_MINIMUM_TRUCK_ROUTE_MONEY) {
- if (GetFreeUnitNumber(VEH_ROAD) > _settings.vehicle.max_roadveh) {
+ if (GetFreeUnitNumber(VEH_ROAD) > _settings_game.vehicle.max_roadveh) {
_players_ainew[p->index].action = AI_ACTION_NONE;
return;
}
@@ -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 - _settings.difficulty.competitor_speed) * AI_BUILDPATH_PAUSE + 1;
+ _players_ainew[p->index].counter = (4 - _settings_game.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 - _settings.difficulty.competitor_speed) * AI_BUILDPATH_PAUSE + 1;
+ _players_ainew[p->index].counter = (4 - _settings_game.difficulty.competitor_speed) * AI_BUILDPATH_PAUSE + 1;
// Increase the building position
_players_ainew[p->index].path_info.position++;
@@ -1035,7 +1035,7 @@ static void AiNew_State_BuildPath(Player *p)
if (_players_ainew[p->index].path_info.position == -2) {
// This means we are done building!
- if (_players_ainew[p->index].tbt == AI_TRUCK && !_settings.pf.roadveh_queue) {
+ if (_players_ainew[p->index].tbt == AI_TRUCK && !_settings_game.pf.roadveh_queue) {
// If they not queue, they have to go up and down to try again at a station...
// We don't want that, so try building some road left or right of the station
DiagDirection dir1, dir2, dir3;
@@ -1186,7 +1186,7 @@ static void AiNew_State_GiveOrders(Player *p)
}
// Very handy for AI, goto depot.. but yeah, it needs to be activated ;)
- if (_settings.order.gotodepot) {
+ if (_settings_game.order.gotodepot) {
idx = 0;
order.MakeGoToDepot(GetDepotByTile(_players_ainew[p->index].depot_tile)->index, ODTFB_PART_OF_ORDERS);
AI_DoCommand(0, _players_ainew[p->index].veh_id + (idx << 16), order.Pack(), DC_EXEC, CMD_INSERT_ORDER);