summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpeter1138 <peter1138@openttd.org>2006-12-07 14:44:26 +0000
committerpeter1138 <peter1138@openttd.org>2006-12-07 14:44:26 +0000
commit339a697c8aa9ef4e900c4258692c73b73dea7862 (patch)
treeb05377836d3105a71ee56524c341801b1504c77a
parent1001bdcd9aa824ef4dbb2f80695c0953210e7496 (diff)
downloadopenttd-339a697c8aa9ef4e900c4258692c73b73dea7862.tar.xz
(svn r7421) -Fix (r2475): Changed "kick off" acceleration resulted in only a small amount of power being applied whilst moving off and then double the power at 1 mph. This resulted in a perceived delay before trains moved. Fix this by applying the full power of the engine (or the kick off, whichever is greater). Essay over.
-rw-r--r--train_cmd.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/train_cmd.c b/train_cmd.c
index 6d56e6166..6f719a2a1 100644
--- a/train_cmd.c
+++ b/train_cmd.c
@@ -400,7 +400,9 @@ static int GetTrainAcceleration(Vehicle *v, bool mode)
resistance += incl;
resistance *= 4; //[N]
- if (speed > 0) {
+ /* Due to the mph to m/s conversion below, at speeds below 3 mph the force is
+ * actually double the train's power */
+ if (speed > 2) {
switch (v->u.rail.railtype) {
case RAILTYPE_RAIL:
case RAILTYPE_ELECTRIC:
@@ -416,7 +418,7 @@ static int GetTrainAcceleration(Vehicle *v, bool mode)
}
} else {
//"kickoff" acceleration
- force = (mass * 8) + resistance;
+ force = max(power, (mass * 8) + resistance);
}
if (force <= 0) force = 10000;