Road vehicles may no longer be stopped on level crossings.

This commit is contained in:
Jonathan G Rennison
2017-05-08 21:54:15 +01:00
parent 0acb4fdd2f
commit 0073c4e71e
4 changed files with 39 additions and 7 deletions

View File

@@ -643,7 +643,11 @@ CommandCost CmdStartStopVehicle(TileIndex tile, DoCommandFlag flags, uint32 p1,
if (HasBit(v->vehicle_flags, VF_TIMETABLE_SEPARATION)) ClrBit(v->vehicle_flags, VF_TIMETABLE_STARTED);
v->vehstatus ^= VS_STOPPED;
if (v->type != VEH_TRAIN) v->cur_speed = 0; // trains can stop 'slowly'
if (v->type == VEH_ROAD) {
if (!RoadVehicle::From(v)->IsRoadVehicleOnLevelCrossing()) v->cur_speed = 0;
} else if (v->type != VEH_TRAIN) {
v->cur_speed = 0; // trains can stop 'slowly'
}
v->MarkDirty();
SetWindowWidgetDirty(WC_VEHICLE_VIEW, v->index, WID_VV_START_STOP);
SetWindowDirty(WC_VEHICLE_DEPOT, v->tile);