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:
@@ -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));
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user