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.
This commit is contained in:
Eddi-z
2019-03-02 18:33:16 +01:00
committed by PeterN
parent 780593ae60
commit b242a04c7d
4 changed files with 6 additions and 3 deletions

View File

@@ -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);
}
/**