mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-13 07:10:57 +00:00
(svn r27190) -Fix [FS#6255] (r27106): Original road vehicle acceleration crashed for vehicles taking over.
This commit is contained in:
parent
83b2ea0eaf
commit
59d41a89c4
@ -824,8 +824,9 @@ static void RoadVehCheckOvertake(RoadVehicle *v, RoadVehicle *u)
|
||||
if (v->state >= RVSB_IN_ROAD_STOP || !IsStraightRoadTrackdir((Trackdir)(v->state & RVSB_TRACKDIR_MASK))) return;
|
||||
|
||||
/* Can't overtake a vehicle that is moving faster than us. If the vehicle in front is
|
||||
* accelerating, take the maximum speed for the comparison, else the current speed. */
|
||||
int u_speed = u->GetAcceleration() > 0 ? u->GetCurrentMaxSpeed() : u->cur_speed;
|
||||
* accelerating, take the maximum speed for the comparison, else the current speed.
|
||||
* Original acceleration always accelerates, so always use the maximum speed. */
|
||||
int u_speed = (_settings_game.vehicle.roadveh_acceleration_model == AM_ORIGINAL || u->GetAcceleration() > 0) ? u->GetCurrentMaxSpeed() : u->cur_speed;
|
||||
if (u_speed >= v->GetCurrentMaxSpeed() &&
|
||||
!(u->vehstatus & VS_STOPPED) &&
|
||||
u->cur_speed != 0) {
|
||||
|
Loading…
Reference in New Issue
Block a user