station_cmd.c
changeset 3482 54b144f07963
parent 3480 dbbc5e1ad694
child 3491 35d747bb5e82
equal deleted inserted replaced
3481:db0ca6fe9800 3482:54b144f07963
  2141 			if ((!(v->current_order.flags & OF_NON_STOP) && !_patches.new_nonstop) ||
  2141 			if ((!(v->current_order.flags & OF_NON_STOP) && !_patches.new_nonstop) ||
  2142 					(v->current_order.type == OT_GOTO_STATION && v->current_order.station == station_id)) {
  2142 					(v->current_order.type == OT_GOTO_STATION && v->current_order.station == station_id)) {
  2143 				if (!(_patches.new_nonstop && v->current_order.flags & OF_NON_STOP) &&
  2143 				if (!(_patches.new_nonstop && v->current_order.flags & OF_NON_STOP) &&
  2144 						v->current_order.type != OT_LEAVESTATION &&
  2144 						v->current_order.type != OT_LEAVESTATION &&
  2145 						v->last_station_visited != station_id) {
  2145 						v->last_station_visited != station_id) {
  2146 					byte dir;
  2146 					DiagDirection dir = DirToDiagDir(v->direction);
  2147 
  2147 
  2148 					x &= 0xF;
  2148 					x &= 0xF;
  2149 					y &= 0xF;
  2149 					y &= 0xF;
  2150 
  2150 
  2151 					dir = v->direction & 6;
  2151 					if (DiagDirToAxis(dir) != AXIS_X) intswap(x, y);
  2152 					if (dir & 2) intswap(x,y);
       
  2153 					if (y == 8) {
  2152 					if (y == 8) {
  2154 						if (dir != 2 && dir != 4) x = ~x & 0xF;
  2153 						if (dir != DIAGDIR_SE && dir != DIAGDIR_SW) x = ~x & 0xF;
  2155 						if (x == 12) return 2 | (station_id << 8); /* enter station */
  2154 						if (x == 12) return 2 | (station_id << 8); /* enter station */
  2156 						if (x < 12) {
  2155 						if (x < 12) {
  2157 							uint16 spd;
  2156 							uint16 spd;
  2158 
  2157 
  2159 							v->vehstatus |= VS_TRAIN_SLOWING;
  2158 							v->vehstatus |= VS_TRAIN_SLOWING;