summaryrefslogtreecommitdiff
path: root/vehicle.c
diff options
context:
space:
mode:
authortron <tron@openttd.org>2006-03-08 08:28:48 +0000
committertron <tron@openttd.org>2006-03-08 08:28:48 +0000
commit2181a72e9ee5db7aa568dd25172e1355e76b4f45 (patch)
tree2ff4a5c18f268f19fbfd9e5f264a66079d450100 /vehicle.c
parent03536a32a189918713ec808bf270d4ad853a7a38 (diff)
downloadopenttd-2181a72e9ee5db7aa568dd25172e1355e76b4f45.tar.xz
(svn r3787) Use DirToDiagDir() instead of >> 1
Diffstat (limited to 'vehicle.c')
-rw-r--r--vehicle.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/vehicle.c b/vehicle.c
index 24d7b731f..6fddacc61 100644
--- a/vehicle.c
+++ b/vehicle.c
@@ -1960,7 +1960,7 @@ Trackdir GetVehicleTrackdir(const Vehicle* v)
return DiagdirToDiagTrackdir(GetDepotDirection(v->tile, TRANSPORT_RAIL)); /* Train in depot */
if (v->u.rail.track == 0x40) /* train in tunnel, so just use his direction and assume a diagonal track */
- return DiagdirToDiagTrackdir((v->direction >> 1) & 3);
+ return DiagdirToDiagTrackdir(DirToDiagDir(v->direction));
return TrackDirectionToTrackdir(FIND_FIRST_BIT(v->u.rail.track),v->direction);
@@ -1978,7 +1978,7 @@ Trackdir GetVehicleTrackdir(const Vehicle* v)
if (IsRoadStationTile(v->tile)) /* We'll assume the road vehicle is facing outwards */
return DiagdirToDiagTrackdir(GetRoadStationDir(v->tile)); /* Road vehicle in a station */
- return DiagdirToDiagTrackdir((v->direction >> 1) & 3);
+ return DiagdirToDiagTrackdir(DirToDiagDir(v->direction));
/* case VEH_Aircraft: case VEH_Special: case VEH_Disaster: */
default: return 0xFF;