train_cmd.c
changeset 76 30511cbc5188
parent 73 34d5f66cfad7
child 98 91d63b83cece
equal deleted inserted replaced
75:9bf1fec1a66a 76:30511cbc5188
  2518 static void CheckIfTrainNeedsService(Vehicle *v)
  2518 static void CheckIfTrainNeedsService(Vehicle *v)
  2519 {
  2519 {
  2520 	uint tile;
  2520 	uint tile;
  2521 	byte depot;
  2521 	byte depot;
  2522 
  2522 
  2523 	if (_patches.servint_trains == 0 && IS_HUMAN_PLAYER(v->owner))
  2523 	if (_patches.servint_trains == 0)
  2524 		return;
  2524 		return;
  2525 
  2525 
  2526 	if (v->date_of_last_service + v->service_interval > _date)
  2526 	if (v->date_of_last_service + v->service_interval > _date)
  2527 		return;
  2527 		return;
  2528 
  2528 
  2529 	if (v->vehstatus & VS_STOPPED)
  2529 	if (v->vehstatus & VS_STOPPED)
  2530 		return;
  2530 		return;
  2531 
  2531 
  2532 	if (_patches.gotodepot && IS_HUMAN_PLAYER(v->owner) && ScheduleHasDepotOrders(v->schedule_ptr))
  2532 	if (_patches.gotodepot && ScheduleHasDepotOrders(v->schedule_ptr))
  2533 		return;
  2533 		return;
  2534 	
  2534 	
  2535 	// Don't interfere with a depot visit scheduled by the user, or a
  2535 	// Don't interfere with a depot visit scheduled by the user, or a
  2536 	// depot visit by the order list.
  2536 	// depot visit by the order list.
  2537 	if ((v->next_order & OT_MASK) == OT_GOTO_DEPOT &&
  2537 	if ((v->next_order & OT_MASK) == OT_GOTO_DEPOT &&