summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortron <tron@openttd.org>2006-07-25 18:32:34 +0000
committertron <tron@openttd.org>2006-07-25 18:32:34 +0000
commit4ca059b0e248ef7e6f765308a182240ab2434ec9 (patch)
tree65470a9774e4f87b346e4ebba44f7ab76c95c057
parentaa32ea5b82248d8996c1b6a06415a6d02ee5130b (diff)
downloadopenttd-4ca059b0e248ef7e6f765308a182240ab2434ec9.tar.xz
(svn r5606) Replace some magic numbers by proper TrackBits enums and macros
-rw-r--r--water_cmd.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/water_cmd.c b/water_cmd.c
index ed1ad1807..1b691757f 100644
--- a/water_cmd.c
+++ b/water_cmd.c
@@ -690,15 +690,16 @@ void TileLoop_Water(TileIndex tile)
static uint32 GetTileTrackStatus_Water(TileIndex tile, TransportType mode)
{
static const byte coast_tracks[] = {0, 32, 4, 0, 16, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0};
- static const byte water_tracks_by_axis[] = {1, 2};
- uint32 ts;
+
+ TrackBits ts;
+
if (mode != TRANSPORT_WATER) return 0;
switch (GetWaterTileType(tile)) {
- case WATER_CLEAR: ts = 0x3F; break;/* We can go everywhere */
+ case WATER_CLEAR: ts = TRACK_BIT_ALL; break;
case WATER_COAST: ts = coast_tracks[GetTileSlope(tile, NULL) & 0xF]; break;
- case WATER_LOCK: ts = water_tracks_by_axis[DiagDirToAxis(GetLockDirection(tile))]; break;
- case WATER_DEPOT: ts = water_tracks_by_axis[GetShipDepotAxis(tile)]; break;
+ case WATER_LOCK: ts = AxisToTrackBits(DiagDirToAxis(GetLockDirection(tile))); break;
+ case WATER_DEPOT: ts = AxisToTrackBits(GetShipDepotAxis(tile)); break;
default: return 0;
}
if (TileX(tile) == 0) {