summaryrefslogtreecommitdiff
path: root/src/roadveh_cmd.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2007-02-14 01:00:57 +0000
committerrubidium <rubidium@openttd.org>2007-02-14 01:00:57 +0000
commit59284954aea6a92103c4545875b634736b904eb6 (patch)
tree8d4676b5d87865ddeafc444a8618a5dbd52b07c5 /src/roadveh_cmd.cpp
parentf7783212b1540303c801c8024b3ea9e42fef8f0a (diff)
downloadopenttd-59284954aea6a92103c4545875b634736b904eb6.tar.xz
(svn r8723) -Codechange: replace yet another couple of magic numbers with enums.
Diffstat (limited to 'src/roadveh_cmd.cpp')
-rw-r--r--src/roadveh_cmd.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/roadveh_cmd.cpp b/src/roadveh_cmd.cpp
index 8ab8167af..6c923c9c1 100644
--- a/src/roadveh_cmd.cpp
+++ b/src/roadveh_cmd.cpp
@@ -1247,6 +1247,11 @@ static uint RoadFindPathToStop(const Vehicle *v, TileIndex tile)
return dist;
}
+enum {
+ RDE_NEXT_TILE = 0x80,
+ RDE_TURNED = 0x40,
+};
+
typedef struct RoadDriveEntry {
byte x,y;
} RoadDriveEntry;
@@ -1379,7 +1384,7 @@ static void RoadVehController(Vehicle *v)
/* Get move position data for next frame */
rd = _road_drive_data[(v->u.road.state + (_opt.road_side << RVS_DRIVE_SIDE)) ^ v->u.road.overtaking][v->u.road.frame + 1];
- if (rd.x & 0x80) {
+ if (rd.x & RDE_NEXT_TILE) {
/* Vehicle is moving to the next tile */
TileIndex tile = v->tile + TileOffsByDiagDir(rd.x & 3);
Trackdir dir = RoadFindPathToDest(v, tile, (DiagDirection)(rd.x & 3));
@@ -1454,7 +1459,7 @@ again:
return;
}
- if (rd.x & 0x40) {
+ if (rd.x & RDE_TURNED) {
/* Vehicle has finished turning around, it will now head back onto the same tile */
Trackdir dir = RoadFindPathToDest(v, v->tile, (DiagDirection)(rd.x & 3));
uint32 r;