changeset 3483:67144af97951 draft

(svn r4332) Turn a table lookup into a ternary operator
author tron <tron@openttd.org>
date Sun, 09 Apr 2006 09:29:50 +0000
parents 901206dd8f9c
children 946c357ba370
files rail_cmd.c
diffstat 1 files changed, 1 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/rail_cmd.c
+++ b/rail_cmd.c
@@ -2011,7 +2011,6 @@
 	-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 @@
 			/* 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);
 			}
 		}
 	}