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

@@ -44,7 +44,7 @@
typedef std::vector<Train *> TrainList;
RailTypeInfo _railtypes[RAILTYPE_END];
std::vector<RailType> _sorted_railtypes;
std::vector<RailType> _sorted_railtypes; ///< Sorted list of rail types.
RailTypes _railtypes_hidden_mask;
/** Enum holding the signal offset in the sprite sheet according to the side it is representing. */
@@ -137,9 +137,8 @@ void InitRailTypes()
_sorted_railtypes.clear();
for (RailType rt = RAILTYPE_BEGIN; rt != RAILTYPE_END; rt++) {
if (_railtypes[rt].label != 0 && !HasBit(_railtypes_hidden_mask, rt)) {
_sorted_railtypes.push_back(rt);
}
if (_railtypes[rt].label == 0) continue;
_sorted_railtypes.push_back(rt);
}
std::sort(_sorted_railtypes.begin(), _sorted_railtypes.end(), CompareRailTypes);
}