src/train_cmd.cpp
changeset 10102 dcd66d9d53af
parent 10083 eee4e42aa15b
child 10103 ad05ade1f2c4
equal deleted inserted replaced
10101:3e0270e9ab9c 10102:dcd66d9d53af
  2323 static void CheckNextTrainTile(Vehicle *v)
  2323 static void CheckNextTrainTile(Vehicle *v)
  2324 {
  2324 {
  2325 	/* Don't do any look-ahead if path_backoff_interval is 255. */
  2325 	/* Don't do any look-ahead if path_backoff_interval is 255. */
  2326 	if (_settings_game.pf.path_backoff_interval == 255) return;
  2326 	if (_settings_game.pf.path_backoff_interval == 255) return;
  2327 
  2327 
  2328 	/* Exit if we reached our destination or are inside a depot. */
  2328 	/* Exit if we reached our destination depot or are inside a depot. */
  2329 	if ((v->tile == v->dest_tile && !v->current_order.IsType(OT_GOTO_STATION)) || v->u.rail.track & TRACK_BIT_DEPOT) return;
  2329 	if ((v->tile == v->dest_tile && v->current_order.IsType(OT_GOTO_DEPOT)) || v->u.rail.track & TRACK_BIT_DEPOT) return;
  2330 	/* Exit if we are on a station tile and are going to stop. */
  2330 	/* Exit if we are on a station tile and are going to stop. */
  2331 	if (IsRailwayStationTile(v->tile) && v->current_order.ShouldStopAtStation(v, GetStationIndex(v->tile))) return;
  2331 	if (IsRailwayStationTile(v->tile) && v->current_order.ShouldStopAtStation(v, GetStationIndex(v->tile))) return;
  2332 	/* Exit if the current order doesn't have a destination, but the train has orders. */
  2332 	/* Exit if the current order doesn't have a destination, but the train has orders. */
  2333 	if ((v->current_order.IsType(OT_NOTHING) || v->current_order.IsType(OT_LEAVESTATION)) && v->num_orders > 0) return;
  2333 	if ((v->current_order.IsType(OT_NOTHING) || v->current_order.IsType(OT_LEAVESTATION)) && v->num_orders > 0) return;
  2334 
  2334