Changeset - r5279:2550172b58b3
[Not reviewed]
master
0 1 0
peter1138 - 18 years ago 2006-12-07 18:58:20
peter1138@openttd.org
(svn r7425) -Fix (r1681): With realistic acceleration, guarantee a minimum braking
force is applied. This ensures trains will stop when going down hill.
1 file changed with 1 insertions and 1 deletions:
0 comments (0 inline, 0 general)
train_cmd.c
Show inline comments
 
@@ -425,13 +425,13 @@ static int GetTrainAcceleration(Vehicle 
 

	
 
	if (v->u.rail.railtype != RAILTYPE_MAGLEV) force = min(force, mass * 10 * 200);
 

	
 
	if (mode == AM_ACCEL) {
 
		return (force - resistance) / (mass * 4);
 
	} else {
 
		return min((-force - resistance) / (mass * 4), 10000 / (mass * 4));
 
		return min((-force - resistance) / (mass * 4), -10000 / (mass * 4));
 
	}
 
}
 

	
 
static void UpdateTrainAcceleration(Vehicle* v)
 
{
 
	uint power = 0;
0 comments (0 inline, 0 general)