summaryrefslogtreecommitdiff
path: root/src/station_map.h
diff options
context:
space:
mode:
authorpeter1138 <peter1138@openttd.org>2008-02-02 09:28:43 +0000
committerpeter1138 <peter1138@openttd.org>2008-02-02 09:28:43 +0000
commitc05d10dd355f5fcbfdf68066bc8d5cabff9f8e3b (patch)
tree44979390033d921d0bb48f8dddd3dec3c4d7267b /src/station_map.h
parent6e761a18d6fd0a8bf3039bdaeaecac58397e0366 (diff)
downloadopenttd-c05d10dd355f5fcbfdf68066bc8d5cabff9f8e3b.tar.xz
(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.
Diffstat (limited to 'src/station_map.h')
-rw-r--r--src/station_map.h17
1 files changed, 5 insertions, 12 deletions
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)