Fix missing water region invalidations for rail with water and water objects
This commit is contained in:
@@ -33,6 +33,7 @@
|
|||||||
#include "newgrf_debug.h"
|
#include "newgrf_debug.h"
|
||||||
#include "vehicle_func.h"
|
#include "vehicle_func.h"
|
||||||
#include "station_func.h"
|
#include "station_func.h"
|
||||||
|
#include "pathfinder/water_regions.h"
|
||||||
|
|
||||||
#include "table/strings.h"
|
#include "table/strings.h"
|
||||||
#include "table/object_land.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) {
|
for (TileIndex t : ta) {
|
||||||
if (IsWaterTile(t)) ClearNeighbourNonFloodingStates(t);
|
if (IsWaterTile(t)) ClearNeighbourNonFloodingStates(t);
|
||||||
|
if (HasTileWaterGround(t)) InvalidateWaterRegion(t);
|
||||||
WaterClass wc = (IsWaterTile(t) ? GetWaterClass(t) : WATER_CLASS_INVALID);
|
WaterClass wc = (IsWaterTile(t) ? GetWaterClass(t) : WATER_CLASS_INVALID);
|
||||||
/* Update company infrastructure counts for objects build on canals owned by nobody. */
|
/* 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))) {
|
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 "news_func.h"
|
||||||
#include "scope.h"
|
#include "scope.h"
|
||||||
#include "newgrf_newsignals.h"
|
#include "newgrf_newsignals.h"
|
||||||
|
#include "pathfinder/water_regions.h"
|
||||||
|
|
||||||
#include "table/strings.h"
|
#include "table/strings.h"
|
||||||
#include "table/railtypes.h"
|
#include "table/railtypes.h"
|
||||||
@@ -3133,6 +3134,7 @@ static CommandCost ClearTile_Track(TileIndex tile, DoCommandFlag flags)
|
|||||||
bool remove = IsDockingTile(tile);
|
bool remove = IsDockingTile(tile);
|
||||||
DoClearSquare(tile);
|
DoClearSquare(tile);
|
||||||
if (remove) RemoveDockingTile(tile);
|
if (remove) RemoveDockingTile(tile);
|
||||||
|
InvalidateWaterRegion(tile);
|
||||||
}
|
}
|
||||||
cost.AddCost(_price[PR_CLEAR_WATER]);
|
cost.AddCost(_price[PR_CLEAR_WATER]);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user