Use std::vector for extra station name strings

This commit is contained in:
Jonathan G Rennison
2024-06-19 20:03:42 +01:00
parent 1e0279e72e
commit eda50ef6a5
6 changed files with 20 additions and 17 deletions

View File

@@ -39,8 +39,7 @@
StationPool _station_pool("Station");
INSTANTIATE_POOL_METHODS(Station)
std::array<ExtraStationNameInfo, MAX_EXTRA_STATION_NAMES> _extra_station_names;
uint _extra_station_names_used;
std::vector<ExtraStationNameInfo> _extra_station_names;
uint8_t _extra_station_names_probability;
const StationCargoList _empty_cargo_list{};
@@ -769,3 +768,11 @@ bool StationCompare::operator() (const Station *lhs, const Station *rhs) const
{
return lhs->index < rhs->index;
}
void ClearExtraStationNames()
{
_extra_station_names.clear();
_extra_station_names.shrink_to_fit();
_extra_station_names_probability = 0;
}