summaryrefslogtreecommitdiff
path: root/vehicle.c
diff options
context:
space:
mode:
Diffstat (limited to 'vehicle.c')
-rw-r--r--vehicle.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/vehicle.c b/vehicle.c
index 6f8558823..0183d04c7 100644
--- a/vehicle.c
+++ b/vehicle.c
@@ -218,6 +218,10 @@ void AfterLoadVehicles(void)
FOR_ALL_VEHICLES(v) {
v->first = NULL;
+ if (v->type == VEH_Train) v->u.rail.first_engine = INVALID_ENGINE;
+ }
+
+ FOR_ALL_VEHICLES(v) {
if (v->type == VEH_Train && (IsFrontEngine(v) || IsFreeWagon(v)))
TrainConsistChanged(v);
}