Fix #14802: close NewGRF inspection window when overbuilding with default station/waypoint

This commit is contained in:
Rubidium
2025-12-06 09:58:25 +01:00
committed by dP
parent bd09b0a76e
commit c60378a0eb
2 changed files with 3 additions and 0 deletions

View File

@@ -1561,6 +1561,7 @@ CommandCost CmdBuildRailStation(DoCommandFlags flags, TileIndex tile_org, RailTy
MakeRailStation(tile, st->owner, st->index, axis, *it, rt);
/* Free the spec if we overbuild something */
DeallocateSpecFromStation(st, old_specindex);
if (statspec == nullptr) DeleteNewGRFInspectWindow(GSF_STATIONS, tile);
SetCustomStationSpecIndex(tile, *specindex);
SetStationTileRandomBits(tile, GB(Random(), 0, 4));