summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/tree_map.h2
-rw-r--r--src/water_map.h4
2 files changed, 4 insertions, 2 deletions
diff --git a/src/tree_map.h b/src/tree_map.h
index e614099fc..df9fd441c 100644
--- a/src/tree_map.h
+++ b/src/tree_map.h
@@ -13,6 +13,7 @@
#define TREE_MAP_H
#include "tile_map.h"
+#include "water_map.h"
/**
* List of tree types along all landscape types.
@@ -133,6 +134,7 @@ static inline void SetTreeGroundDensity(TileIndex t, TreeGround g, uint d)
assert(IsTileType(t, MP_TREES)); // XXX incomplete
SB(_m[t].m2, 4, 2, d);
SB(_m[t].m2, 6, 3, g);
+ SetWaterClass(t, g == TREE_GROUND_SHORE ? WATER_CLASS_SEA : WATER_CLASS_INVALID);
}
/**
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);
}
/**