summaryrefslogtreecommitdiff
path: root/src/roadveh_cmd.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2007-02-13 10:26:53 +0000
committerrubidium <rubidium@openttd.org>2007-02-13 10:26:53 +0000
commita419f4aedadc526377d24e30bfd967e29255498e (patch)
treea8d30d13565c6ebb15b7a0857e33c317d033e666 /src/roadveh_cmd.cpp
parenteab6dd989821a2cacb96a94de0da789214f6e2b4 (diff)
downloadopenttd-a419f4aedadc526377d24e30bfd967e29255498e.tar.xz
(svn r8698) -Codechange: enumify the returns of VehicleEnterTile
Diffstat (limited to 'src/roadveh_cmd.cpp')
-rw-r--r--src/roadveh_cmd.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/roadveh_cmd.cpp b/src/roadveh_cmd.cpp
index 3c1278985..34035e621 100644
--- a/src/roadveh_cmd.cpp
+++ b/src/roadveh_cmd.cpp
@@ -1340,7 +1340,7 @@ static void RoadVehController(Vehicle *v)
return;
}
- if ((IsTunnelTile(gp.new_tile) || IsBridgeTile(gp.new_tile)) && VehicleEnterTile(v, gp.new_tile, gp.x, gp.y) & 4) {
+ if ((IsTunnelTile(gp.new_tile) || IsBridgeTile(gp.new_tile)) && HASBIT(VehicleEnterTile(v, gp.new_tile, gp.x, gp.y), VETS_ENTERED_WORMHOLE)) {
/* Vehicle has just entered a bridge or tunnel */
v->cur_image = GetRoadVehImage(v, v->direction);
UpdateRoadVehDeltaXY(v);
@@ -1388,7 +1388,7 @@ again:
if (RoadVehFindCloseTo(v, x, y, newdir) != NULL) return;
r = VehicleEnterTile(v, tile, x, y);
- if (r & 8) {
+ if (HASBIT(r, VETS_CANNOT_ENTER)) {
/* Vehicle cannot enter the tile */
if (!IsTileType(tile, MP_TUNNELBRIDGE)) {
v->cur_speed = 0;
@@ -1416,7 +1416,7 @@ again:
}
}
- if (!(r & 4)) {
+ if (!HASBIT(r, VETS_ENTERED_WORMHOLE)) {
/* Set vehicle to first frame on new tile */
v->tile = tile;
v->u.road.state = (byte)dir;
@@ -1457,7 +1457,7 @@ again:
if (RoadVehFindCloseTo(v, x, y, newdir) != NULL) return;
r = VehicleEnterTile(v, v->tile, x, y);
- if (r & 8) {
+ if (HASBIT(r, VETS_CANNOT_ENTER)) {
/* Vehicle cannot enter the tile */
v->cur_speed = 0;
return;
@@ -1599,7 +1599,7 @@ again:
/* Check tile position conditions - i.e. stop position in depot,
* entry onto bridge or into tunnel */
r = VehicleEnterTile(v, v->tile, x, y);
- if (r & 8) {
+ if (HASBIT(r, VETS_CANNOT_ENTER)) {
/* Vehicle cannot continue */
v->cur_speed = 0;
return;
@@ -1607,7 +1607,7 @@ again:
/* Move to next frame unless vehicle arrived at a stop position
* in a depot or entered a tunnel/bridge */
- if ((r & 4) == 0) v->u.road.frame++;
+ if (!HASBIT(r, VETS_ENTERED_WORMHOLE)) v->u.road.frame++;
v->cur_image = GetRoadVehImage(v, v->direction);
UpdateRoadVehDeltaXY(v);