summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2008-07-27 09:12:18 +0000
committerfrosch <frosch@openttd.org>2008-07-27 09:12:18 +0000
commit74c63ac9e2ef72b8c73f355d08a66ce0052e4861 (patch)
treea0fcddd96b43997dced54289051cf9b4f307b71e
parent4da23a628006a52fd3ed4735d3f04bee23d81ae0 (diff)
downloadopenttd-74c63ac9e2ef72b8c73f355d08a66ce0052e4861.tar.xz
(svn r13845) -Fix (r13838): When adding a WaterClass to oilrig station tiles, also make use of it.
-rw-r--r--src/station_cmd.cpp2
-rw-r--r--src/water_cmd.cpp5
2 files changed, 5 insertions, 2 deletions
diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp
index 67afd5a1d..95c8ae5e7 100644
--- a/src/station_cmd.cpp
+++ b/src/station_cmd.cpp
@@ -2193,7 +2193,7 @@ static void DrawTile_Station(TileInfo *ti)
if (t == NULL || t->seq == NULL) t = &_station_display_datas[GetStationType(ti->tile)][GetStationGfx(ti->tile)];
- if (IsBuoy(ti->tile) || IsDock(ti->tile)) {
+ if (IsBuoy(ti->tile) || IsDock(ti->tile) || IsOilRig(ti->tile)) {
if (ti->tileh == SLOPE_FLAT) {
DrawWaterClassGround(ti);
} else {
diff --git a/src/water_cmd.cpp b/src/water_cmd.cpp
index dd90530ed..db6872178 100644
--- a/src/water_cmd.cpp
+++ b/src/water_cmd.cpp
@@ -535,7 +535,10 @@ static bool IsWateredTile(TileIndex tile, Direction from)
}
return false;
- case MP_STATION: return IsOilRig(tile) || (IsDock(tile) && GetTileSlope(tile, NULL) == SLOPE_FLAT) || IsBuoy(tile);
+ case MP_STATION:
+ if (IsOilRig(tile)) return GetWaterClass(tile) != WATER_CLASS_INVALID;
+ return (IsDock(tile) && GetTileSlope(tile, NULL) == SLOPE_FLAT) || IsBuoy(tile);
+
case MP_INDUSTRY: return IsIndustryTileOnWater(tile);
case MP_TUNNELBRIDGE: return GetTunnelBridgeTransportType(tile) == TRANSPORT_WATER && ReverseDiagDir(GetTunnelBridgeDirection(tile)) == DirToDiagDir(from);
default: return false;