mirror of
https://github.com/OpenTTD/OpenTTD
synced 2026-01-20 19:02:41 +01:00
Codechange: change DestinationID into class with conversion helpers
A DestinationID is either a DepotID or StationID, where the aircraft hangar being conceptually a depot is actually a StationID. When making those types stronger, a lot of casts would need to be added, but this shows the intent much better.
This commit is contained in:
@@ -4194,7 +4194,7 @@ void Train::OnNewEconomyDay()
|
||||
|
||||
/* update destination */
|
||||
if (this->current_order.IsType(OT_GOTO_STATION)) {
|
||||
TileIndex tile = Station::Get(this->current_order.GetDestination())->train_station.tile;
|
||||
TileIndex tile = Station::Get(this->current_order.GetDestination().ToStationID())->train_station.tile;
|
||||
if (tile != INVALID_TILE) this->dest_tile = tile;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user