Changeset - r3482:f77945b1ea3d
[Not reviewed]
master
0 1 0
tron - 18 years ago 2006-04-09 08:25:43
tron@openttd.org
(svn r4331) Replace some direction calculation magic with DiagDirection to make a bit more clear what's going on
1 file changed with 3 insertions and 4 deletions:
0 comments (0 inline, 0 general)
station_cmd.c
Show inline comments
 
@@ -2143,15 +2143,14 @@ static uint32 VehicleEnter_Station(Vehic
 
				if (!(_patches.new_nonstop && v->current_order.flags & OF_NON_STOP) &&
 
						v->current_order.type != OT_LEAVESTATION &&
 
						v->last_station_visited != station_id) {
 
					byte dir;
 
					DiagDirection dir = DirToDiagDir(v->direction);
 

	
 
					x &= 0xF;
 
					y &= 0xF;
 

	
 
					dir = v->direction & 6;
 
					if (dir & 2) intswap(x,y);
 
					if (DiagDirToAxis(dir) != AXIS_X) intswap(x, y);
 
					if (y == 8) {
 
						if (dir != 2 && dir != 4) x = ~x & 0xF;
 
						if (dir != DIAGDIR_SE && dir != DIAGDIR_SW) x = ~x & 0xF;
 
						if (x == 12) return 2 | (station_id << 8); /* enter station */
 
						if (x < 12) {
 
							uint16 spd;
0 comments (0 inline, 0 general)