1
0
Fork 0

(svn r5222) Misc. smaller changes, mostly const, variable scope and replacing some magic numbers by enums

release/0.5
tron 2006-06-11 07:17:43 +00:00
parent 4ba334ffde
commit 0f5453d95b
1 changed files with 128 additions and 119 deletions

View File

@ -114,9 +114,10 @@ static void AiStateVehLoop(Player *p)
} }
/* not reliable? */ /* not reliable? */
if ((v->age != 0 && if (v->age >= v->max_age || (
GetEngine(v->engine_type)->reliability < 35389) || v->age != 0 &&
v->age >= v->max_age) { GetEngine(v->engine_type)->reliability < 35389
)) {
p->ai.state = AIS_VEH_CHECK_REPLACE_VEHICLE; p->ai.state = AIS_VEH_CHECK_REPLACE_VEHICLE;
p->ai.cur_veh = v; p->ai.cur_veh = v;
return; return;
@ -148,8 +149,7 @@ static EngineID AiChooseTrainToBuild(RailType railtype, int32 money, byte flag,
} }
ret = DoCommand(tile, i, 0, 0, CMD_BUILD_RAIL_VEHICLE); ret = DoCommand(tile, i, 0, 0, CMD_BUILD_RAIL_VEHICLE);
if (!CmdFailed(ret) && ret <= money && if (!CmdFailed(ret) && ret <= money && rvi->ai_rank >= best_veh_score) {
rvi->ai_rank >= best_veh_score) {
best_veh_score = rvi->ai_rank; best_veh_score = rvi->ai_rank;
best_veh_index = i; best_veh_index = i;
} }
@ -162,16 +162,16 @@ static EngineID AiChooseRoadVehToBuild(CargoID cargo, int32 money, TileIndex til
{ {
EngineID best_veh_index = INVALID_ENGINE; EngineID best_veh_index = INVALID_ENGINE;
int32 best_veh_cost = 0; int32 best_veh_cost = 0;
int32 ret;
EngineID i = _cargoc.ai_roadveh_start[cargo]; EngineID i = _cargoc.ai_roadveh_start[cargo];
EngineID end = i + _cargoc.ai_roadveh_count[cargo]; EngineID end = i + _cargoc.ai_roadveh_count[cargo];
for (; i != end; i++) { for (; i != end; i++) {
const Engine* e = GetEngine(i); const Engine* e = GetEngine(i);
int32 ret;
if (!HASBIT(e->player_avail, _current_player) || e->reliability < 0x8A3D) if (!HASBIT(e->player_avail, _current_player) || e->reliability < 0x8A3D) {
continue; continue;
}
ret = DoCommand(tile, i, 0, 0, CMD_BUILD_ROAD_VEH); ret = DoCommand(tile, i, 0, 0, CMD_BUILD_ROAD_VEH);
if (!CmdFailed(ret) && ret <= money && ret >= best_veh_cost) { if (!CmdFailed(ret) && ret <= money && ret >= best_veh_cost) {
@ -187,18 +187,17 @@ static EngineID AiChooseAircraftToBuild(int32 money, byte flag)
{ {
EngineID best_veh_index = INVALID_ENGINE; EngineID best_veh_index = INVALID_ENGINE;
int32 best_veh_cost = 0; int32 best_veh_cost = 0;
EngineID i;
for (i = AIRCRAFT_ENGINES_INDEX; i != AIRCRAFT_ENGINES_INDEX + NUM_AIRCRAFT_ENGINES; i++) {
const Engine* e = GetEngine(i);
int32 ret; int32 ret;
EngineID i = AIRCRAFT_ENGINES_INDEX; if (!HASBIT(e->player_avail, _current_player) || e->reliability < 0x8A3D) {
EngineID end = i + NUM_AIRCRAFT_ENGINES;
for (; i != end; i++) {
const Engine* e = GetEngine(i);
if (!HASBIT(e->player_avail, _current_player) || e->reliability < 0x8A3D)
continue; continue;
}
if (flag&1) { if (flag & 1) {
if (i<253) continue; if (i<253) continue;
} else { } else {
if (i>=253) continue; if (i>=253) continue;
@ -214,7 +213,7 @@ static EngineID AiChooseAircraftToBuild(int32 money, byte flag)
return best_veh_index; return best_veh_index;
} }
static int32 AiGetBasePrice(Player *p) static int32 AiGetBasePrice(const Player* p)
{ {
int32 base = _price.station_value; int32 base = _price.station_value;
@ -238,23 +237,23 @@ static EngineID AiChooseShipToBuild(byte cargo, int32 money)
} }
#endif #endif
static EngineID AiChooseRoadVehToReplaceWith(Player* p, Vehicle* v) static EngineID AiChooseRoadVehToReplaceWith(const Player* p, const Vehicle* v)
{ {
int32 avail_money = p->player_money + v->value; int32 avail_money = p->player_money + v->value;
return AiChooseRoadVehToBuild(v->cargo_type, avail_money, v->tile); return AiChooseRoadVehToBuild(v->cargo_type, avail_money, v->tile);
} }
static EngineID AiChooseAircraftToReplaceWith(Player* p, Vehicle* v) static EngineID AiChooseAircraftToReplaceWith(const Player* p, const Vehicle* v)
{ {
int32 avail_money = p->player_money + v->value; int32 avail_money = p->player_money + v->value;
return AiChooseAircraftToBuild(avail_money, v->engine_type>=253?1:0); return AiChooseAircraftToBuild(avail_money, v->engine_type>=253?1:0);
} }
static EngineID AiChooseTrainToReplaceWith(Player* p, Vehicle* v) static EngineID AiChooseTrainToReplaceWith(const Player* p, const Vehicle* v)
{ {
int32 avail_money = p->player_money + v->value; int32 avail_money = p->player_money + v->value;
int num=0; const Vehicle* u = v;
Vehicle *u = v; int num = 0;
while (++num, u->next != NULL) { while (++num, u->next != NULL) {
u = u->next; u = u->next;
@ -264,7 +263,7 @@ static EngineID AiChooseTrainToReplaceWith(Player* p, Vehicle* v)
return AiChooseTrainToBuild(v->u.rail.railtype, avail_money, 0, v->tile); return AiChooseTrainToBuild(v->u.rail.railtype, avail_money, 0, v->tile);
} }
static EngineID AiChooseShipToReplaceWith(Player* p, Vehicle* v) static EngineID AiChooseShipToReplaceWith(const Player* p, const Vehicle* v)
{ {
error("!AiChooseShipToReplaceWith"); error("!AiChooseShipToReplaceWith");
@ -301,7 +300,7 @@ static void AiRestoreVehicleOrders(Vehicle *v, BackuppedOrders *bak)
static void AiHandleReplaceTrain(Player *p) static void AiHandleReplaceTrain(Player *p)
{ {
Vehicle *v = p->ai.cur_veh; const Vehicle* v = p->ai.cur_veh;
BackuppedOrders orderbak[1]; BackuppedOrders orderbak[1];
EngineID veh; EngineID veh;
@ -331,7 +330,7 @@ static void AiHandleReplaceTrain(Player *p)
static void AiHandleReplaceRoadVeh(Player *p) static void AiHandleReplaceRoadVeh(Player *p)
{ {
Vehicle *v = p->ai.cur_veh; const Vehicle* v = p->ai.cur_veh;
BackuppedOrders orderbak[1]; BackuppedOrders orderbak[1];
EngineID veh; EngineID veh;
@ -360,7 +359,7 @@ static void AiHandleReplaceRoadVeh(Player *p)
static void AiHandleReplaceAircraft(Player *p) static void AiHandleReplaceAircraft(Player *p)
{ {
Vehicle *v = p->ai.cur_veh; const Vehicle* v = p->ai.cur_veh;
BackuppedOrders orderbak[1]; BackuppedOrders orderbak[1];
EngineID veh; EngineID veh;
@ -392,7 +391,7 @@ static void AiHandleReplaceShip(Player *p)
error("!AiHandleReplaceShip"); error("!AiHandleReplaceShip");
} }
typedef EngineID CheckReplaceProc(Player* p, Vehicle* v); typedef EngineID CheckReplaceProc(const Player* p, const Vehicle* v);
static CheckReplaceProc* const _veh_check_replace_proc[] = { static CheckReplaceProc* const _veh_check_replace_proc[] = {
AiChooseTrainToReplaceWith, AiChooseTrainToReplaceWith,
@ -411,7 +410,7 @@ static DoReplaceProc* const _veh_do_replace_proc[] = {
static void AiStateCheckReplaceVehicle(Player *p) static void AiStateCheckReplaceVehicle(Player *p)
{ {
Vehicle *v = p->ai.cur_veh; const Vehicle* v = p->ai.cur_veh;
if (v->type == 0 || if (v->type == 0 ||
v->owner != _current_player || v->owner != _current_player ||
@ -457,9 +456,8 @@ static void AiFindSubsidyIndustryRoute(FoundRoute *fr)
{ {
uint i; uint i;
CargoID cargo; CargoID cargo;
Subsidy *s; const Subsidy* s;
Industry *from, *to_ind; Industry* from;
Town *to_tow;
TileIndex to_xy; TileIndex to_xy;
// initially error // initially error
@ -473,20 +471,25 @@ static void AiFindSubsidyIndustryRoute(FoundRoute *fr)
// Don't want passengers or mail // Don't want passengers or mail
cargo = s->cargo_type; cargo = s->cargo_type;
if (cargo == CT_INVALID || cargo == CT_PASSENGERS || cargo == CT_MAIL || s->age > 7) if (cargo == CT_INVALID ||
cargo == CT_PASSENGERS ||
cargo == CT_MAIL ||
s->age > 7) {
return; return;
}
fr->cargo = cargo; fr->cargo = cargo;
fr->from = from = GetIndustry(s->from); fr->from = from = GetIndustry(s->from);
if (cargo == CT_GOODS || cargo == CT_FOOD) { if (cargo == CT_GOODS || cargo == CT_FOOD) {
to_tow = GetTown(s->to); Town* to_tow = GetTown(s->to);
if (to_tow->population < (uint32)(cargo == CT_FOOD ? 200 : 900))
return; // error if (to_tow->population < (cargo == CT_FOOD ? 200 : 900)) return; // error
fr->to = to_tow; fr->to = to_tow;
to_xy = to_tow->xy; to_xy = to_tow->xy;
} else { } else {
to_ind = GetIndustry(s->to); Industry* to_ind = GetIndustry(s->to);
fr->to = to_ind; fr->to = to_ind;
to_xy = to_ind->xy; to_xy = to_ind->xy;
} }
@ -497,7 +500,7 @@ static void AiFindSubsidyIndustryRoute(FoundRoute *fr)
static void AiFindSubsidyPassengerRoute(FoundRoute *fr) static void AiFindSubsidyPassengerRoute(FoundRoute *fr)
{ {
uint i; uint i;
Subsidy *s; const Subsidy* s;
Town *from,*to; Town *from,*to;
// initially error // initially error
@ -524,8 +527,7 @@ static void AiFindSubsidyPassengerRoute(FoundRoute *fr)
static void AiFindRandomIndustryRoute(FoundRoute *fr) static void AiFindRandomIndustryRoute(FoundRoute *fr)
{ {
Industry *i,*i2; Industry* i;
Town *t;
uint32 r; uint32 r;
CargoID cargo; CargoID cargo;
@ -545,21 +547,27 @@ static void AiFindRandomIndustryRoute(FoundRoute *fr)
fr->cargo = cargo; fr->cargo = cargo;
// don't allow passengers // don't allow passengers
if (cargo == 0xFF || cargo == CT_PASSENGERS) return; if (cargo == CT_INVALID || cargo == CT_PASSENGERS) return;
if (cargo != CT_GOODS && cargo != CT_FOOD) { if (cargo != CT_GOODS && cargo != CT_FOOD) {
// pick a dest, and see if it can receive // pick a dest, and see if it can receive
i2 = AiFindRandomIndustry(); Industry* i2 = AiFindRandomIndustry();
if (i2 == NULL || i == i2 || !(i2->accepts_cargo[0] == cargo || i2->accepts_cargo[1] == cargo || i2->accepts_cargo[2] == cargo))
if (i2 == NULL || i == i2 || (
i2->accepts_cargo[0] != cargo &&
i2->accepts_cargo[1] != cargo &&
i2->accepts_cargo[2] != cargo)
) {
return; return;
}
fr->to = i2; fr->to = i2;
fr->distance = DistanceManhattan(i->xy, i2->xy); fr->distance = DistanceManhattan(i->xy, i2->xy);
} else { } else {
// pick a dest town, and see if it's big enough // pick a dest town, and see if it's big enough
t = AiFindRandomTown(); Town* t = AiFindRandomTown();
if (t == NULL || t->population < (uint32)(cargo == CT_FOOD ? 200 : 900))
return; if (t == NULL || t->population < (cargo == CT_FOOD ? 200 : 900)) return;
fr->to = t; fr->to = t;
fr->distance = DistanceManhattan(i->xy, t->xy); fr->distance = DistanceManhattan(i->xy, t->xy);
@ -590,7 +598,7 @@ static bool AiCheckIfRouteIsGood(Player *p, FoundRoute *fr, byte bitmask)
{ {
TileIndex from_tile, to_tile; TileIndex from_tile, to_tile;
Station *st; Station *st;
int dist, cur; int dist;
uint same_station = 0; uint same_station = 0;
// Make sure distance to closest station is < 37 pixels. // Make sure distance to closest station is < 37 pixels.
@ -598,7 +606,10 @@ static bool AiCheckIfRouteIsGood(Player *p, FoundRoute *fr, byte bitmask)
to_tile = GET_TOWN_OR_INDUSTRY_TILE(fr->to); to_tile = GET_TOWN_OR_INDUSTRY_TILE(fr->to);
dist = 0xFFFF; dist = 0xFFFF;
FOR_ALL_STATIONS(st) if (st->xy != 0 && st->owner == _current_player) { FOR_ALL_STATIONS(st) {
int cur;
if (st->xy == 0 || st->owner != _current_player) continue;
cur = DistanceMax(from_tile, st->xy); cur = DistanceMax(from_tile, st->xy);
if (cur < dist) dist = cur; if (cur < dist) dist = cur;
cur = DistanceMax(to_tile, st->xy); cur = DistanceMax(to_tile, st->xy);
@ -610,7 +621,7 @@ static bool AiCheckIfRouteIsGood(Player *p, FoundRoute *fr, byte bitmask)
// For each road or airport station, we want 350 of population! // For each road or airport station, we want 350 of population!
if ((bitmask == 2 || bitmask == 4) && if ((bitmask == 2 || bitmask == 4) &&
same_station > 2 && same_station > 2 &&
((Town*)(fr->from))->population < same_station * 350) { ((Town*)fr->from)->population < same_station * 350) {
return false; return false;
} }
@ -623,21 +634,27 @@ static bool AiCheckIfRouteIsGood(Player *p, FoundRoute *fr, byte bitmask)
} }
if (fr->cargo == CT_PASSENGERS || fr->cargo == CT_MAIL) { if (fr->cargo == CT_PASSENGERS || fr->cargo == CT_MAIL) {
if (((Town*)fr->from)->pct_pass_transported > 0x99 || const Town* from = fr->from;
((Town*)fr->to)->pct_pass_transported > 0x99) const Town* to = fr->to;
if (from->pct_pass_transported > 0x99 ||
to->pct_pass_transported > 0x99) {
return false; return false;
}
// Make sure it has a reasonably good rating // Make sure it has a reasonably good rating
if (((Town*)fr->from)->ratings[_current_player] < -100 || if (from->ratings[_current_player] < -100 ||
((Town*)fr->to)->ratings[_current_player] < -100) to->ratings[_current_player] < -100) {
return false; return false;
}
} else { } else {
const Industry* i = (const Industry*)fr->from; const Industry* i = (const Industry*)fr->from;
if (i->pct_transported[fr->cargo != i->produced_cargo[0]] > 0x99 || if (i->pct_transported[fr->cargo != i->produced_cargo[0]] > 0x99 ||
i->total_production[fr->cargo != i->produced_cargo[0]] == 0) i->total_production[fr->cargo != i->produced_cargo[0]] == 0) {
return false; return false;
} }
}
p->ai.route_type_mask |= bitmask; p->ai.route_type_mask |= bitmask;
return true; return true;
@ -1504,25 +1521,22 @@ static void AiStateWantNewRoute(Player *p)
static bool AiCheckTrackResources(TileIndex tile, const AiDefaultBlockData *p, byte cargo) static bool AiCheckTrackResources(TileIndex tile, const AiDefaultBlockData *p, byte cargo)
{ {
uint values[NUM_CARGO]; uint rad = (_patches.modified_catchment) ? CA_TRAIN : 4;
int rad;
for (;p->mode != 4;p++) if (p->mode == 1) { for (; p->mode != 4; p++) {
TileIndex tile2 = TILE_ADD(tile, ToTileIndexDiff(p->tileoffs)); AcceptedCargo values;
TileIndex tile2;
uint w; uint w;
uint h; uint h;
if (p->mode != 1) continue;
tile2 = TILE_ADD(tile, ToTileIndexDiff(p->tileoffs));
w = GB(p->attr, 1, 3); w = GB(p->attr, 1, 3);
h = GB(p->attr, 4, 3); h = GB(p->attr, 4, 3);
if (p->attr & 1) uintswap(w, h); if (p->attr & 1) uintswap(w, h);
if (_patches.modified_catchment) {
rad = CA_TRAIN;
} else {
rad = 4;
}
if (cargo & 0x80) { if (cargo & 0x80) {
GetProductionAroundTiles(values, tile2, w, h, rad); GetProductionAroundTiles(values, tile2, w, h, rad);
return values[cargo & 0x7F] != 0; return values[cargo & 0x7F] != 0;
@ -1876,7 +1890,7 @@ static bool AiIsTileBanned(const Player* p, TileIndex tile, byte val)
static void AiBanTile(Player* p, TileIndex tile, byte val) static void AiBanTile(Player* p, TileIndex tile, byte val)
{ {
int i; uint i;
for (i = lengthof(p->ai.banned_tiles) - 1; i != 0; i--) { for (i = lengthof(p->ai.banned_tiles) - 1; i != 0; i--) {
p->ai.banned_tiles[i] = p->ai.banned_tiles[i - 1]; p->ai.banned_tiles[i] = p->ai.banned_tiles[i - 1];
@ -1954,15 +1968,14 @@ static inline void AiCheckBuildRailBridgeHere(AiRailFinder *arf, TileIndex tile,
} }
// Is building a (rail)bridge possible at this place (type doesn't matter)? // Is building a (rail)bridge possible at this place (type doesn't matter)?
if (CmdFailed(DoCommand(tile_new, tile, 0 | arf->player->ai.railtype_to_use << 8, if (CmdFailed(DoCommand(tile_new, tile, 0 | arf->player->ai.railtype_to_use << 8, DC_AUTO, CMD_BUILD_BRIDGE))) {
DC_AUTO, CMD_BUILD_BRIDGE)) )
return; return;
}
AiBuildRailRecursive(arf, tile_new, dir2); AiBuildRailRecursive(arf, tile_new, dir2);
// At the bottom depth, check if the new path is better than the old one. // At the bottom depth, check if the new path is better than the old one.
if (arf->depth == 1) { if (arf->depth == 1) {
if (AiCheckRailPathBetter(arf, p)) if (AiCheckRailPathBetter(arf, p)) arf->bridge_end_tile = tile_new;
arf->bridge_end_tile = tile_new;
} }
} }
} }
@ -1991,14 +2004,12 @@ static void AiBuildRailRecursive(AiRailFinder *arf, TileIndex tile, int dir)
// Reached destination? // Reached destination?
if (tile == arf->final_tile) { if (tile == arf->final_tile) {
if (arf->final_dir != (dir^2)) { if (arf->final_dir != (dir^2)) {
if (arf->recursive_mode != 2) if (arf->recursive_mode != 2) arf->recursive_mode = 1;
arf->recursive_mode = 1;
} else if (arf->recursive_mode != 2) { } else if (arf->recursive_mode != 2) {
arf->recursive_mode = 2; arf->recursive_mode = 2;
arf->cur_best_depth = arf->depth; arf->cur_best_depth = arf->depth;
} else { } else {
if (arf->depth < arf->cur_best_depth) if (arf->depth < arf->cur_best_depth) arf->cur_best_depth = arf->depth;
arf->cur_best_depth = arf->depth;
} }
return; return;
} }
@ -2226,24 +2237,31 @@ static void AiBuildRailDestruct(Player *p)
static void AiBuildRail(Player *p) static void AiBuildRail(Player *p)
{ {
if (p->ai.state_mode < 1) { switch (p->ai.state_mode) {
// Construct mode, build new rail. case 0: // Construct mode, build new rail.
AiBuildRailConstruct(p); AiBuildRailConstruct(p);
} else if (p->ai.state_mode == 1) { break;
// Destruct mode, destroy the rail currently built.
case 1: // Destruct mode, destroy the rail currently built.
AiBuildRailDestruct(p); AiBuildRailDestruct(p);
} else if (p->ai.state_mode == 2) { break;
case 2: {
uint i; uint i;
// Terraform some and then try building again. // Terraform some and then try building again.
for (i = 0; i != 4; i++) for (i = 0; i != 4; i++) {
AiDoTerraformLand(p->ai.cur_tile_a, p->ai.cur_dir_a, 3, 0); AiDoTerraformLand(p->ai.cur_tile_a, p->ai.cur_dir_a, 3, 0);
}
if (++p->ai.state_counter == 4) { if (++p->ai.state_counter == 4) {
p->ai.state_counter = 0; p->ai.state_counter = 0;
p->ai.state_mode = 0; p->ai.state_mode = 0;
} }
} }
default: break;
}
} }
static void AiStateBuildRail(Player *p) static void AiStateBuildRail(Player *p)
@ -2463,19 +2481,15 @@ handle_nocash:
static void AiStateDeleteRailBlocks(Player *p) static void AiStateDeleteRailBlocks(Player *p)
{ {
int num; const AiBuildRec* aib = &p->ai.src;
AiBuildRec *aib; uint num = p->ai.num_build_rec;
const AiDefaultBlockData *b;
num = p->ai.num_build_rec;
aib = &p->ai.src;
do { do {
if (aib->cur_building_rule != 255) { const AiDefaultBlockData* b;
b = _default_rail_track_data[aib->cur_building_rule]->data;
while (b->mode != 4) { if (aib->cur_building_rule == 255) continue;
for (b = _default_rail_track_data[aib->cur_building_rule]->data; b->mode != 4; b++) {
DoCommand(TILE_ADD(aib->use_tile, ToTileIndexDiff(b->tileoffs)), 0, 0, DC_EXEC, CMD_LANDSCAPE_CLEAR); DoCommand(TILE_ADD(aib->use_tile, ToTileIndexDiff(b->tileoffs)), 0, 0, DC_EXEC, CMD_LANDSCAPE_CLEAR);
b++;
}
} }
} while (++aib,--num); } while (++aib,--num);
@ -2812,13 +2826,13 @@ static bool AiCheckRoadFinished(Player *p)
static bool AiBuildRoadHelper(TileIndex tile, int flags, int type) static bool AiBuildRoadHelper(TileIndex tile, int flags, int type)
{ {
static const byte _road_bits[] = { static const RoadBits _road_bits[] = {
8+2, ROAD_X,
1+4, ROAD_Y,
1+8, ROAD_NW | ROAD_NE,
4+2, ROAD_SW | ROAD_SE,
1+2, ROAD_NW | ROAD_SW,
8+4, ROAD_SE | ROAD_NE
}; };
return !CmdFailed(DoCommand(tile, _road_bits[type], 0, flags, CMD_BUILD_ROAD)); return !CmdFailed(DoCommand(tile, _road_bits[type], 0, flags, CMD_BUILD_ROAD));
} }
@ -3191,22 +3205,17 @@ static void AiStateBuildRoadVehicles(Player *p)
static void AiStateDeleteRoadBlocks(Player *p) static void AiStateDeleteRoadBlocks(Player *p)
{ {
int num; const AiBuildRec* aib = &p->ai.src;
AiBuildRec *aib; uint num = p->ai.num_build_rec;
const AiDefaultBlockData *b;
num = p->ai.num_build_rec;
aib = &p->ai.src;
do { do {
if (aib->cur_building_rule != 255) { const AiDefaultBlockData* b;
b = _road_default_block_data[aib->cur_building_rule]->data;
while (b->mode != 4) { if (aib->cur_building_rule == 255) continue;
if (b->mode <= 1) { for (b = _road_default_block_data[aib->cur_building_rule]->data; b->mode != 4; b++) {
if (b->mode > 1) continue;
DoCommand(TILE_ADD(aib->use_tile, ToTileIndexDiff(b->tileoffs)), 0, 0, DC_EXEC, CMD_LANDSCAPE_CLEAR); DoCommand(TILE_ADD(aib->use_tile, ToTileIndexDiff(b->tileoffs)), 0, 0, DC_EXEC, CMD_LANDSCAPE_CLEAR);
} }
b++;
}
}
} while (++aib,--num); } while (++aib,--num);
p->ai.state = AIS_0; p->ai.state = AIS_0;
@ -3818,7 +3827,7 @@ static void AiHandleTakeover(Player *p)
} }
} }
static void AiAdjustLoan(Player *p) static void AiAdjustLoan(const Player* p)
{ {
int32 base = AiGetBasePrice(p); int32 base = AiGetBasePrice(p);