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:
@@ -198,8 +198,8 @@ const Order *LinkRefresher::PredictNextOrder(const Order *cur, const Order *next
|
||||
*/
|
||||
void LinkRefresher::RefreshStats(const Order *cur, const Order *next)
|
||||
{
|
||||
StationID next_station = next->GetDestination();
|
||||
Station *st = Station::GetIfValid(cur->GetDestination());
|
||||
StationID next_station = next->GetDestination().ToStationID();
|
||||
Station *st = Station::GetIfValid(cur->GetDestination().ToStationID());
|
||||
if (st != nullptr && next_station != INVALID_STATION && next_station != st->index) {
|
||||
Station *st_to = Station::Get(next_station);
|
||||
for (CargoType c = 0; c < NUM_CARGO; c++) {
|
||||
|
||||
Reference in New Issue
Block a user