Changeset - r1969:287ecec5b3b7
[Not reviewed]
master
0 1 0
celestar - 19 years ago 2005-06-23 06:19:06
celestar@openttd.org
(svn r2475) -Fix: [ 1214982 & 1217473 ] realistic acceleration problem. (glx)
1 file changed with 1 insertions and 1 deletions:
0 comments (0 inline, 0 general)
train_cmd.c
Show inline comments
 
@@ -303,25 +303,25 @@ static int GetTrainAcceleration(Vehicle 
 
			case 1:
 
				force = power / speed; //[N]
 
				force *= 22;
 
				force /= 10;
 
				break;
 

	
 
			case 2:
 
				force = power / 25;
 
				break;
 
		}
 
	} else {
 
		//"kickoff" acceleration
 
		force = resistance * 10;
 
		force = (mass * 8) + resistance;
 
	}
 

	
 
	if (force <= 0) force = 10000;
 

	
 
	if (v->u.rail.railtype != 2) 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));
 
	}
 
}
0 comments (0 inline, 0 general)