diff options
Diffstat (limited to 'src/ai/api')
-rw-r--r-- | src/ai/api/ai_order.cpp | 2 | ||||
-rw-r--r-- | src/ai/api/ai_vehiclelist.cpp | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/ai/api/ai_order.cpp b/src/ai/api/ai_order.cpp index b45bab956..1e18333fa 100644 --- a/src/ai/api/ai_order.cpp +++ b/src/ai/api/ai_order.cpp @@ -349,7 +349,7 @@ static const Order *ResolveOrder(VehicleID vehicle_id, AIOrder::OrderPosition or order.MakeGoToDepot(::GetStationIndex(destination), odtf, onsf, odaf); } else { if (::IsTileType(destination, MP_STATION)) return false; - order.MakeGoToDepot(::Depot::GetByTile(destination)->index, odtf, onsf, odaf); + order.MakeGoToDepot(::GetDepotIndex(destination), odtf, onsf, odaf); } break; } diff --git a/src/ai/api/ai_vehiclelist.cpp b/src/ai/api/ai_vehiclelist.cpp index 5e1fb6b07..61cbc9198 100644 --- a/src/ai/api/ai_vehiclelist.cpp +++ b/src/ai/api/ai_vehiclelist.cpp @@ -63,19 +63,19 @@ AIVehicleList_Depot::AIVehicleList_Depot(TileIndex tile) case MP_RAILWAY: if (!IsRailDepot(tile)) return; type = VEH_TRAIN; - dest = Depot::GetByTile(tile)->index; + dest = GetDepotIndex(tile); break; case MP_ROAD: if (!IsRoadDepot(tile)) return; type = VEH_ROAD; - dest = Depot::GetByTile(tile)->index; + dest = GetDepotIndex(tile); break; case MP_WATER: if (!IsShipDepot(tile)) return; type = VEH_SHIP; - dest = Depot::GetByTile(min(tile, GetOtherShipDepotTile(tile)))->index; + dest = GetDepotIndex(tile); break; default: // No depot |