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.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/train_cmd.cpp b/src/train_cmd.cpp
index a475c61ec..f850f7c42 100644
--- a/src/train_cmd.cpp
+++ b/src/train_cmd.cpp
@@ -95,6 +95,9 @@ void TrainPowerChanged(Vehicle* v)
}
if (v->u.rail.cached_power != total_power || v->u.rail.cached_max_te != max_te) {
+ /* If it has no power (no catenary), stop the train */
+ if (total_power == 0) v->vehstatus |= VS_STOPPED;
+
v->u.rail.cached_power = total_power;
v->u.rail.cached_max_te = max_te;
InvalidateWindow(WC_VEHICLE_DETAILS, v->index);