summaryrefslogtreecommitdiff
path: root/src/train_cmd.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/train_cmd.cpp')
-rw-r--r--src/train_cmd.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/train_cmd.cpp b/src/train_cmd.cpp
index 0ac6f657c..4f7fef012 100644
--- a/src/train_cmd.cpp
+++ b/src/train_cmd.cpp
@@ -118,6 +118,9 @@ void TrainPowerChanged(Vehicle *v)
if (engine_has_power) {
uint16 power = GetVehicleProperty(u, 0x0B, rvi_u->power);
if (power != 0) {
+ /* Halve power for multiheaded parts */
+ if (IsMultiheaded(u)) power /= 2;
+
total_power += power;
/* Tractive effort in (tonnes * 1000 * 10 =) N */
max_te += (u->u.rail.cached_veh_weight * 10000 * GetVehicleProperty(u, 0x1F, rvi_u->tractive_effort)) / 256;
@@ -3499,6 +3502,9 @@ Money Train::GetRunningCost() const
byte cost_factor = GetVehicleProperty(v, 0x0D, rvi->running_cost);
if (cost_factor == 0) continue;
+ /* Halve running cost for multiheaded parts */
+ if (IsMultiheaded(v)) cost_factor /= 2;
+
cost += cost_factor * GetPriceByIndex(rvi->running_cost_class);
} while ((v = GetNextVehicle(v)) != NULL);