diff options
author | rubidium <rubidium@openttd.org> | 2007-08-31 19:46:45 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2007-08-31 19:46:45 +0000 |
commit | dd60e3b7dd0756121c3634c113382fdb1ba1601d (patch) | |
tree | 179e7da8ba60e46123f8b3eccfd65d4c4acb37bf /src | |
parent | 9695727120c3315c219d9b05492fb28d6aec99e1 (diff) | |
download | openttd-dd60e3b7dd0756121c3634c113382fdb1ba1601d.tar.xz |
(svn r11022) -Fix: the canal border determination did not take oil rigs into consideration.
Diffstat (limited to 'src')
-rw-r--r-- | src/water_cmd.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/water_cmd.cpp b/src/water_cmd.cpp index 428cd5f4b..4a069840f 100644 --- a/src/water_cmd.cpp +++ b/src/water_cmd.cpp @@ -26,6 +26,7 @@ #include "train.h" #include "roadveh.h" #include "water_map.h" +#include "industry_map.h" #include "newgrf.h" #include "newgrf_canal.h" #include "misc/autoptr.hpp" @@ -362,8 +363,9 @@ static bool IsWateredTile(TileIndex tile) return false; } - case MP_STATION: return IsOilRig(tile) || IsDock(tile) || IsBuoy(tile); - default: return false; + case MP_STATION: return IsOilRig(tile) || IsDock(tile) || IsBuoy(tile); + case MP_INDUSTRY: return (GetIndustrySpec(GetIndustryType(tile))->behaviour & INDUSTRYBEH_BUILT_ONWATER) != 0; + default: return false; } } @@ -377,10 +379,10 @@ void DrawCanalWater(TileIndex tile) if (dikes_base == 0) dikes_base = SPR_CANALS_BASE + 57; /* determine the edges around with water. */ - wa = IsWateredTile(TILE_ADDXY(tile, -1, 0)) << 0; - wa += IsWateredTile(TILE_ADDXY(tile, 0, 1)) << 1; - wa += IsWateredTile(TILE_ADDXY(tile, 1, 0)) << 2; - wa += IsWateredTile(TILE_ADDXY(tile, 0, -1)) << 3; + wa = IsWateredTile(TILE_ADDXY(tile, -1, 0)) << 0; + wa += IsWateredTile(TILE_ADDXY(tile, 0, 1)) << 1; + wa += IsWateredTile(TILE_ADDXY(tile, 1, 0)) << 2; + wa += IsWateredTile(TILE_ADDXY(tile, 0, -1)) << 3; if (!(wa & 1)) DrawGroundSprite(dikes_base, PAL_NONE); if (!(wa & 2)) DrawGroundSprite(dikes_base + 1, PAL_NONE); |