Codechange: Use std::vector for station speclist

This removes manual memory allocation, although we still manage the list
size in roughly the same way.
This commit is contained in:
Peter Nelson
2022-11-05 22:48:45 +00:00
committed by Michael Lutz
parent 4dc741a8a0
commit 22803f997b
4 changed files with 28 additions and 42 deletions

View File

@@ -51,8 +51,6 @@ void RebuildStationKdtree()
BaseStation::~BaseStation()
{
free(this->speclist);
if (CleaningPool()) return;
CloseWindowById(WC_TRAINS_LIST, VehicleListIdentifier(VL_STATION_LIST, VEH_TRAIN, this->owner, this->index).Pack());
@@ -227,7 +225,7 @@ void Station::MarkTilesDirty(bool cargo_change) const
/* Don't waste time updating if there are no custom station graphics
* that might change. Even if there are custom graphics, they might
* not change. Unfortunately we have no way of telling. */
if (this->num_specs == 0) return;
if (this->speclist.size() == 0) return;
}
for (h = 0; h < train_station.h; h++) {