mirror of
https://github.com/OpenTTD/OpenTTD
synced 2026-01-23 20:24:12 +01:00
Fix c02ef3e456: [AI] Incorrect infrastructure cost for road/tram tiles. (#14596)
Infrastructure total count should be split between road and tram pieces.
This commit is contained in:
@@ -104,8 +104,9 @@
|
||||
case INFRASTRUCTURE_ROAD: {
|
||||
Money cost;
|
||||
uint32_t road_total = c->infrastructure.GetRoadTotal();
|
||||
uint32_t tram_total = c->infrastructure.GetTramTotal();
|
||||
for (::RoadType rt = ::ROADTYPE_BEGIN; rt != ::ROADTYPE_END; rt++) {
|
||||
cost += RoadMaintenanceCost(rt, c->infrastructure.road[rt], road_total);
|
||||
cost += RoadMaintenanceCost(rt, c->infrastructure.road[rt], RoadTypeIsRoad(rt) ? road_total : tram_total);
|
||||
}
|
||||
return cost;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user