summaryrefslogtreecommitdiff
path: root/src/water_map.h
diff options
context:
space:
mode:
authorEddi-z <43699911+Eddi-z@users.noreply.github.com>2019-03-02 18:33:16 +0100
committerPeterN <peter@fuzzle.org>2019-03-02 17:33:16 +0000
commitb242a04c7d530e5d73c809c53ae857455231a4c6 (patch)
treeb2057df1cda905a1e81ff48881b27d8362f578ac /src/water_map.h
parent780593ae6010adb3e80620cfcac99934330a14ae (diff)
downloadopenttd-b242a04c7d530e5d73c809c53ae857455231a4c6.tar.xz
Fix #7307: Add WaterClass to MP_TREES, set when trees are on coast tiles (#7309)
This allows allows NewGRF object/industry placement rules to treat trees on coast tiles the same as regular bare coast.
Diffstat (limited to 'src/water_map.h')
-rw-r--r--src/water_map.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/water_map.h b/src/water_map.h
index ab249a827..5d84d5ba6 100644
--- a/src/water_map.h
+++ b/src/water_map.h
@@ -94,7 +94,7 @@ static inline WaterTileType GetWaterTileType(TileIndex t)
*/
static inline bool HasTileWaterClass(TileIndex t)
{
- return IsTileType(t, MP_WATER) || IsTileType(t, MP_STATION) || IsTileType(t, MP_INDUSTRY) || IsTileType(t, MP_OBJECT);
+ return IsTileType(t, MP_WATER) || IsTileType(t, MP_STATION) || IsTileType(t, MP_INDUSTRY) || IsTileType(t, MP_OBJECT) || IsTileType(t, MP_TREES);
}
/**
@@ -204,7 +204,7 @@ static inline bool IsCoast(TileIndex t)
*/
static inline bool IsCoastTile(TileIndex t)
{
- return IsTileType(t, MP_WATER) && IsCoast(t);
+ return (IsTileType(t, MP_WATER) && IsCoast(t)) || (IsTileType(t, MP_TREES) && GetWaterClass(t) != WATER_CLASS_INVALID);
}
/**