From 50769995c7934e8a12d7da1e28aa84b5264f3e59 Mon Sep 17 00:00:00 2001 From: rubidium Date: Fri, 27 Aug 2010 22:29:13 +0000 Subject: (svn r20640) -Add: support for water under objects --- src/object_cmd.cpp | 5 ++++- src/water_cmd.cpp | 3 +++ 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/object_cmd.cpp b/src/object_cmd.cpp index 5c39529c8..262f9142f 100644 --- a/src/object_cmd.cpp +++ b/src/object_cmd.cpp @@ -19,6 +19,7 @@ #include "genworld.h" #include "autoslope.h" #include "functions.h" +#include "water.h" #include "window_func.h" #include "company_gui.h" #include "cheat_type.h" @@ -316,7 +317,7 @@ static CommandCost ClearTile_Object(TileIndex tile, DoCommandFlag flags) } if (flags & DC_EXEC) { - TILE_AREA_LOOP(tile_cur, ta) DoClearSquare(tile_cur); + TILE_AREA_LOOP(tile_cur, ta) MakeWaterKeepingClass(tile_cur, GetTileOwner(tile_cur)); delete o; } @@ -356,6 +357,8 @@ static void GetTileDesc_Object(TileIndex tile, TileDesc *td) static void TileLoop_Object(TileIndex tile) { + if (IsTileOnWater(tile)) TileLoop_Water(tile); + if (!IsCompanyHQ(tile)) return; /* HQ accepts passenger and mail; but we have to divide the values diff --git a/src/water_cmd.cpp b/src/water_cmd.cpp index fcd834052..6f24956b1 100644 --- a/src/water_cmd.cpp +++ b/src/water_cmd.cpp @@ -499,6 +499,8 @@ static bool IsWateredTile(TileIndex tile, Direction from) return IsTileOnWater(tile); } + case MP_OBJECT: return IsTileOnWater(tile); + case MP_TUNNELBRIDGE: return GetTunnelBridgeTransportType(tile) == TRANSPORT_WATER && ReverseDiagDir(GetTunnelBridgeDirection(tile)) == DirToDiagDir(from); default: return false; @@ -935,6 +937,7 @@ FloodingBehaviour GetFloodingBehaviour(TileIndex tile) /* FALL THROUGH */ case MP_STATION: case MP_INDUSTRY: + case MP_OBJECT: return (GetWaterClass(tile) == WATER_CLASS_SEA) ? FLOOD_ACTIVE : FLOOD_NONE; case MP_RAILWAY: -- cgit v1.2.3-70-g09d2