Fix: Autoreplace rail/road list only listed buildable types. (#13887)

Instead list all possible types which includes hidden types compatible with buildable types.
This commit is contained in:
Peter Nelson
2025-03-25 08:22:30 +00:00
committed by GitHub
parent 1fb4c44bc7
commit adb20f99ea
5 changed files with 10 additions and 8 deletions

View File

@@ -52,7 +52,7 @@
typedef std::vector<RoadVehicle *> RoadVehicleList;
RoadTypeInfo _roadtypes[ROADTYPE_END];
std::vector<RoadType> _sorted_roadtypes;
std::vector<RoadType> _sorted_roadtypes; ///< Sorted list of road types.
RoadTypes _roadtypes_hidden_mask;
/**
@@ -121,9 +121,8 @@ void InitRoadTypes()
_sorted_roadtypes.clear();
for (RoadType rt = ROADTYPE_BEGIN; rt != ROADTYPE_END; rt++) {
if (_roadtypes[rt].label != 0 && !HasBit(_roadtypes_hidden_mask, rt)) {
_sorted_roadtypes.push_back(rt);
}
if (_roadtypes[rt].label == 0) continue;
_sorted_roadtypes.push_back(rt);
}
std::sort(_sorted_roadtypes.begin(), _sorted_roadtypes.end(), CompareRoadTypes);
}