diff options
author | tron <tron@openttd.org> | 2006-03-06 20:28:28 +0000 |
---|---|---|
committer | tron <tron@openttd.org> | 2006-03-06 20:28:28 +0000 |
commit | 2d3c28f2b3d24c2b01e54a51e2dcf5ad7f4851c8 (patch) | |
tree | 410be31dd2267cd8af3257b3d145965515575d34 /roadveh_cmd.c | |
parent | fc1e9c5a92ccfeaea09b1fcd1bb58f1de4cb2644 (diff) | |
download | openttd-2d3c28f2b3d24c2b01e54a51e2dcf5ad7f4851c8.tar.xz |
(svn r3776) Replace many ints and magic numbers by Direction, DiagDirection and friends
Diffstat (limited to 'roadveh_cmd.c')
-rw-r--r-- | roadveh_cmd.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/roadveh_cmd.c b/roadveh_cmd.c index f74257a47..17decca9c 100644 --- a/roadveh_cmd.c +++ b/roadveh_cmd.c @@ -309,7 +309,6 @@ static bool EnumRoadSignalFindDepot(TileIndex tile, void* data, int track, uint static const Depot* FindClosestRoadDepot(const Vehicle* v) { TileIndex tile = v->tile; - int i; if (v->u.road.state == 255) tile = GetVehicleOutOfTunnelTile(v); @@ -327,6 +326,8 @@ static const Depot* FindClosestRoadDepot(const Vehicle* v) /* We do not search in two directions here, why should we? We can't reverse right now can we? */ } else { RoadFindDepotData rfdd; + DiagDirection i; + rfdd.owner = v->owner; rfdd.best_length = (uint)-1; @@ -1187,14 +1188,14 @@ static void RoadVehController(Vehicle *v) if (v->current_order.type == OT_LOADING) return; if (v->u.road.state == 254) { - int dir; + DiagDirection dir; const RoadDriveEntry* rdp; byte rd2; v->cur_speed = 0; dir = GB(_m[v->tile].m5, 0, 2); - v->direction = dir * 2 + 1; + v->direction = DiagDirToDir(dir); rd2 = _roadveh_data_2[dir]; rdp = _road_drive_data[(_opt.road_side << 4) + rd2]; |