Codechange: Store grfid with entity grfprops.
This allows using the grfid without having to dereference the grffile pointer. Uses no extra storage as it fits within otherwise wasted padding space.
This commit is contained in:
committed by
Peter Nelson
parent
e750d10cee
commit
e73d6fcaac
@@ -87,7 +87,7 @@ void MoveWaypointsToBaseStations()
|
||||
* from the GRF ID / station index. */
|
||||
for (OldWaypoint &wp : _old_waypoints) {
|
||||
const auto specs = StationClass::Get(STAT_CLASS_WAYP)->Specs();
|
||||
auto found = std::ranges::find_if(specs, [&wp](const StationSpec *spec) { return spec != nullptr && spec->grf_prop.grffile->grfid == wp.grfid && spec->grf_prop.local_id == wp.localidx; });
|
||||
auto found = std::ranges::find_if(specs, [&wp](const StationSpec *spec) { return spec != nullptr && spec->grf_prop.grfid == wp.grfid && spec->grf_prop.local_id == wp.localidx; });
|
||||
if (found != std::end(specs)) wp.spec = *found;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user