1
0
Fork 0

Fix #12347: Crash attempting to find catchment tiles of a station with no catchment area.

pull/12348/head
Peter Nelson 2024-03-21 18:19:41 +00:00
parent 0eaeeaabb6
commit cbe0307504
No known key found for this signature in database
GPG Key ID: 8EF8F0A467DF75ED
1 changed files with 4 additions and 1 deletions

View File

@ -152,7 +152,10 @@ ScriptTileList_StationCoverage::ScriptTileList_StationCoverage(StationID station
{
if (!ScriptStation::IsValidStation(station_id)) return;
BitmapTileIterator it(::Station::Get(station_id)->catchment_tiles);
const BitmapTileArea &ta = ::Station::Get(station_id)->catchment_tiles;
if (ta.tile == INVALID_TILE) return;
BitmapTileIterator it(ta);
for (TileIndex tile = it; tile != INVALID_TILE; tile = ++it) {
this->AddTile(tile);
}