From c05d10dd355f5fcbfdf68066bc8d5cabff9f8e3b Mon Sep 17 00:00:00 2001 From: peter1138 Date: Sat, 2 Feb 2008 09:28:43 +0000 Subject: (svn r12042) -Fix [FS#1676]: Reimplement how rivers and canals are stored in the map, allowing the sea/river/canal status to also be stored for buoys, docks, locks and depots. All these are now allowed on rivers and removal of them will revert to the original water type. --- src/station_map.h | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) (limited to 'src/station_map.h') diff --git a/src/station_map.h b/src/station_map.h index b4e40ccef..f2a2f86dd 100644 --- a/src/station_map.h +++ b/src/station_map.h @@ -7,6 +7,7 @@ #include "rail_map.h" #include "road_map.h" +#include "water_map.h" #include "station.h" #include "rail.h" @@ -155,16 +156,6 @@ static inline bool IsBuoyTile(TileIndex t) return IsTileType(t, MP_STATION) && IsBuoy(t); } -static inline bool IsCanalBuoyTile(TileIndex t) -{ - return IsBuoyTile(t) && !IsTileOwner(t, OWNER_WATER); -} - -static inline bool IsSeaBuoyTile(TileIndex t) -{ - return IsBuoyTile(t) && IsTileOwner(t, OWNER_WATER); -} - static inline bool IsHangarTile(TileIndex t) { return IsTileType(t, MP_STATION) && IsHangar(t); @@ -287,18 +278,20 @@ static inline void MakeAirport(TileIndex t, Owner o, StationID sid, byte section MakeStation(t, o, sid, STATION_AIRPORT, section); } -static inline void MakeBuoy(TileIndex t, StationID sid) +static inline void MakeBuoy(TileIndex t, StationID sid, WaterClass wc) { /* Make the owner of the buoy tile the same as the current owner of the * water tile. In this way, we can reset the owner of the water to its * original state when the buoy gets removed. */ MakeStation(t, GetTileOwner(t), sid, STATION_BUOY, 0); + SetWaterClass(t, wc); } -static inline void MakeDock(TileIndex t, Owner o, StationID sid, DiagDirection d) +static inline void MakeDock(TileIndex t, Owner o, StationID sid, DiagDirection d, WaterClass wc) { MakeStation(t, o, sid, STATION_DOCK, d); MakeStation(t + TileOffsByDiagDir(d), o, sid, STATION_DOCK, GFX_DOCK_BASE_WATER_PART + DiagDirToAxis(d)); + SetWaterClass(t + TileOffsByDiagDir(d), wc); } static inline void MakeOilrig(TileIndex t, StationID sid) -- cgit v1.2.3-54-g00ecf