mirror of
https://github.com/OpenTTD/OpenTTD
synced 2026-01-25 05:04:07 +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:
@@ -2741,7 +2741,7 @@ int WhoCanServiceIndustry(Industry *ind)
|
||||
for (const Order *o : v->Orders()) {
|
||||
if (o->IsType(OT_GOTO_STATION) && !(o->GetUnloadType() & OUFB_TRANSFER)) {
|
||||
/* Vehicle visits a station to load or unload */
|
||||
Station *st = Station::Get(o->GetDestination());
|
||||
Station *st = Station::Get(o->GetDestination().ToStationID());
|
||||
assert(st != nullptr);
|
||||
|
||||
/* Same cargo produced by industry is dropped here => not serviced by vehicle v */
|
||||
|
||||
Reference in New Issue
Block a user