Fix missing water region invalidations for rail with water and water objects

pull/642/head
Jonathan G Rennison 5 months ago
parent 1914c11459
commit 316d34918f

@ -33,6 +33,7 @@
#include "newgrf_debug.h"
#include "vehicle_func.h"
#include "station_func.h"
#include "pathfinder/water_regions.h"
#include "table/strings.h"
#include "table/object_land.h"
@ -169,6 +170,7 @@ void BuildObject(ObjectType type, TileIndex tile, CompanyID owner, Town *town, u
for (TileIndex t : ta) {
if (IsWaterTile(t)) ClearNeighbourNonFloodingStates(t);
if (HasTileWaterGround(t)) InvalidateWaterRegion(t);
WaterClass wc = (IsWaterTile(t) ? GetWaterClass(t) : WATER_CLASS_INVALID);
/* Update company infrastructure counts for objects build on canals owned by nobody. */
if (wc == WATER_CLASS_CANAL && owner != OWNER_NONE && (IsTileOwner(t, OWNER_NONE) || IsTileOwner(t, OWNER_WATER))) {

@ -40,6 +40,7 @@
#include "news_func.h"
#include "scope.h"
#include "newgrf_newsignals.h"
#include "pathfinder/water_regions.h"
#include "table/strings.h"
#include "table/railtypes.h"
@ -3133,6 +3134,7 @@ static CommandCost ClearTile_Track(TileIndex tile, DoCommandFlag flags)
bool remove = IsDockingTile(tile);
DoClearSquare(tile);
if (remove) RemoveDockingTile(tile);
InvalidateWaterRegion(tile);
}
cost.AddCost(_price[PR_CLEAR_WATER]);
}

Loading…
Cancel
Save