Changeset - r22033:7dfdb58be409
[Not reviewed]
master
0 1 0
frosch - 10 years ago 2015-03-16 20:01:14
frosch@openttd.org
(svn r27190) -Fix [FS#6255] (r27106): Original road vehicle acceleration crashed for vehicles taking over.
1 file changed with 3 insertions and 2 deletions:
0 comments (0 inline, 0 general)
src/roadveh_cmd.cpp
Show inline comments
 
@@ -821,14 +821,15 @@ static void RoadVehCheckOvertake(RoadVeh
 
	if (v->direction != u->direction || !(v->direction & 1)) return;
 

	
 
	/* Check if vehicle is in a road stop, depot, tunnel or bridge or not on a straight road */
 
	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) {
 
		return;
 
	}
 

	
0 comments (0 inline, 0 general)