Merge branch 'reverse_at_waypoint' into jgrpp

Conflicts:
	src/order_gui.cpp
	src/saveload/extended_ver_sl.cpp
	src/saveload/extended_ver_sl.h
	src/train_cmd.cpp
This commit is contained in:
Jonathan G Rennison
2015-10-29 00:59:42 +00:00
17 changed files with 147 additions and 36 deletions

View File

@@ -1683,6 +1683,7 @@ void VehicleEnterDepot(Vehicle *v)
t->force_proceed = TFP_NONE;
ClrBit(t->flags, VRF_TOGGLE_REVERSE);
t->ConsistChanged(CCF_ARRANGE);
t->reverse_distance = 0;
break;
}
@@ -2801,6 +2802,8 @@ static void SpawnAdvancedVisualEffect(const Vehicle *v)
}
}
uint16 ReversingDistanceTargetSpeed(const Train *v);
/**
* Draw visual effects (smoke and/or sparks) for a vehicle chain.
* @pre this->IsPrimaryVehicle()
@@ -2829,10 +2832,12 @@ void Vehicle::ShowVisualEffect() const
/* For trains, do not show any smoke when:
* - the train is reversing
* - is entering a station with an order to stop there and its speed is equal to maximum station entering speed
* - is approaching a reversing point and its speed is equal to maximum approach speed
*/
if (HasBit(t->flags, VRF_REVERSING) ||
(IsRailStationTile(t->tile) && t->IsFrontEngine() && t->current_order.ShouldStopAtStation(t, GetStationIndex(t->tile)) &&
t->cur_speed >= max_speed)) {
t->cur_speed >= max_speed) ||
(t->reverse_distance >= 1 && t->cur_speed >= ReversingDistanceTargetSpeed(t))) {
return;
}
}