--- a/src/ai/default/default.cpp Fri Mar 23 12:03:41 2007 +0000
+++ b/src/ai/default/default.cpp Sat Mar 31 12:34:36 2007 +0000
@@ -99,7 +99,7 @@
v->type == VEH_SHIP) {
/* replace engine? */
if (v->type == VEH_TRAIN && v->engine_type < 3 &&
- (_price.build_railvehicle >> 3) < p->player_money) {
+ (_eco->GetPrice(CEconomy::BUILD_RAILVEHICLE) >> 3) < p->player_money) {
p->ai.state = AIS_VEH_CHECK_REPLACE_VEHICLE;
p->ai.cur_veh = v;
return;
@@ -107,8 +107,8 @@
/* not profitable? */
if (v->age >= 730 &&
- v->profit_last_year < _price.station_value * 5 &&
- v->profit_this_year < _price.station_value * 5) {
+ v->profit_last_year < _eco->GetPrice(CEconomy::STATION_VALUE) * 5 &&
+ v->profit_this_year < _eco->GetPrice(CEconomy::STATION_VALUE) * 5) {
p->ai.state_counter = 0;
p->ai.state = AIS_SELL_VEHICLE;
p->ai.cur_veh = v;
@@ -226,7 +226,7 @@
static int32 AiGetBasePrice(const Player* p)
{
- int32 base = _price.station_value;
+ int32 base = _eco->GetPrice(CEconomy::STATION_VALUE);
// adjust base price when more expensive vehicles are available
switch (p->ai.railtype_to_use) {
@@ -1628,7 +1628,7 @@
ret = DoCommand(c, k, 0, flag, CMD_BUILD_SIGNALS);
} while (--j);
} else {
- ret = _price.build_signals;
+ ret = _eco->GetPrice(CEconomy::BUILD_SIGNALS);
}
if (CmdFailed(ret)) return CMD_ERROR;
total_cost += ret;
@@ -1638,7 +1638,7 @@
if (GetTileSlope(c, NULL) != SLOPE_FLAT) return CMD_ERROR;
ret = DoCommand(c, 0, 0, flag | DC_AUTO | DC_NO_WATER | DC_AI_BUILDING, CMD_LANDSCAPE_CLEAR);
if (CmdFailed(ret)) return CMD_ERROR;
- total_cost += ret + _price.build_rail;
+ total_cost += ret + _eco->GetPrice(CEconomy::PRICE_RAIL_BUILD, c);
if (flag & DC_EXEC) {
DoCommand(c, railtype, p->attr&1, flag | DC_AUTO | DC_NO_WATER | DC_AI_BUILDING, CMD_BUILD_SINGLE_RAIL);