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

@@ -3244,6 +3244,11 @@ static VehicleEnterTileStatus VehicleEnter_Station(Vehicle *v, TileIndex tile, i
{
if (v->type == VEH_TRAIN) {
StationID station_id = GetStationIndex(tile);
if (v->current_order.IsType(OT_GOTO_WAYPOINT) && v->current_order.GetDestination() == station_id && v->current_order.GetWaypointFlags() & OWF_REVERSE) {
Train *t = Train::From(v);
// reverse at waypoint
if (t->reverse_distance == 0) t->reverse_distance = t->gcache.cached_total_length;
}
if (!v->current_order.ShouldStopAtStation(v, station_id)) return VETSB_CONTINUE;
if (!IsRailStation(tile) || !v->IsFrontEngine()) return VETSB_CONTINUE;