1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2025-12-10 06:52:05 +01:00

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 rubidium42
parent 1445aa9543
commit 6e65b2387a
2 changed files with 3 additions and 0 deletions

View File

@@ -1558,6 +1558,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));

View File

@@ -26,6 +26,7 @@
#include "vehicle_func.h"
#include "string_func.h"
#include "company_func.h"
#include "newgrf_debug.h"
#include "newgrf_station.h"
#include "newgrf_roadstop.h"
#include "company_base.h"
@@ -315,6 +316,7 @@ CommandCost CmdBuildRailWaypoint(DoCommandFlags flags, TileIndex start_tile, Axi
MarkTileDirtyByTile(tile);
DeallocateSpecFromStation(wp, old_specindex);
if (spec == nullptr) DeleteNewGRFInspectWindow(GSF_STATIONS, tile);
YapfNotifyTrackLayoutChange(tile, AxisToTrack(axis));
}
DirtyCompanyInfrastructureWindows(wp->owner);