Changeset - r16456:d0d0065bf655
[Not reviewed]
master
0 1 0
terkhen - 14 years ago 2010-11-14 15:48:24
terkhen@openttd.org
(svn r21189) -Fix: Force a minimum speed for trains when using the realistic acceleration model.
1 file changed with 3 insertions and 1 deletions:
0 comments (0 inline, 0 general)
src/train_cmd.cpp
Show inline comments
 
@@ -2799,7 +2799,9 @@ int Train::UpdateSpeed()
 
		if (this->cur_speed > max_speed) {
 
			tempmax = this->cur_speed - (this->cur_speed / 10) - 1;
 
		}
 
		this->cur_speed = spd = Clamp(this->cur_speed + ((int)spd >> 8), 0, tempmax);
 
		/* Force a minimum speed of 1 km/h when realistic acceleration is on. */
 
		int min_speed = (_settings_game.vehicle.train_acceleration_model == AM_ORIGINAL) ? 0 : 2;
 
		this->cur_speed = spd = Clamp(this->cur_speed + ((int)spd >> 8), min_speed, tempmax);
 
	}
 

	
 
	int scaled_spd = this->GetAdvanceSpeed(spd);
0 comments (0 inline, 0 general)