summaryrefslogtreecommitdiff
path: root/rail_cmd.c
diff options
context:
space:
mode:
authortron <tron@openttd.org>2006-04-09 09:29:50 +0000
committertron <tron@openttd.org>2006-04-09 09:29:50 +0000
commit8111eca43e9f066eca41b157d60bad6050fc1cfd (patch)
treebaf3b8d58563614c020c77044966af7ffe0d2c5a /rail_cmd.c
parentfade7a5997aacccb45a2e673e6b30620356cb260 (diff)
downloadopenttd-8111eca43e9f066eca41b157d60bad6050fc1cfd.tar.xz
(svn r4332) Turn a table lookup into a ternary operator
Diffstat (limited to 'rail_cmd.c')
-rw-r--r--rail_cmd.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/rail_cmd.c b/rail_cmd.c
index a3124570c..35c7b43d4 100644
--- a/rail_cmd.c
+++ b/rail_cmd.c
@@ -2011,7 +2011,6 @@ static const byte _deltacoord_leaveoffset[8] = {
-1, 0, 1, 0, /* x */
0, 1, 0, -1 /* y */
};
-static const byte _depot_track_mask[4] = {1, 2, 1, 2};
static uint32 VehicleEnter_Track(Vehicle *v, TileIndex tile, int x, int y)
{
@@ -2058,8 +2057,7 @@ static uint32 VehicleEnter_Track(Vehicle *v, TileIndex tile, int x, int y)
/* leave the depot? */
if ((v = v->next) != NULL) {
v->vehstatus &= ~VS_HIDDEN;
- v->u.rail.track = _depot_track_mask[dir];
- assert(v->u.rail.track);
+ v->u.rail.track = (DiagDirToAxis(dir) == AXIS_X ? 1 : 2);
}
}
}