summaryrefslogtreecommitdiff
path: root/src/vehicle_cmd.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/vehicle_cmd.cpp')
-rw-r--r--src/vehicle_cmd.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/vehicle_cmd.cpp b/src/vehicle_cmd.cpp
index 7271d27b0..545629108 100644
--- a/src/vehicle_cmd.cpp
+++ b/src/vehicle_cmd.cpp
@@ -30,6 +30,7 @@
#include "order_backup.h"
#include "ship.h"
#include "newgrf.h"
+#include "cargodest_func.h"
#include "company_base.h"
#include "table/strings.h"
@@ -147,6 +148,7 @@ CommandCost CmdBuildVehicle(TileIndex tile, DoCommandFlag flags, uint32 p1, uint
if (v->IsPrimaryVehicle()) {
GroupStatistics::CountVehicle(v, 1);
OrderBackup::Restore(v, p2);
+ PrefillRouteLinks(v);
}
}
@@ -478,6 +480,8 @@ CommandCost CmdRefitVehicle(TileIndex tile, DoCommandFlag flags, uint32 p1, uint
default: NOT_REACHED();
}
+ if (front->IsPrimaryVehicle()) PrefillRouteLinks(front);
+
InvalidateWindowData(WC_VEHICLE_DETAILS, front->index);
SetWindowDirty(WC_VEHICLE_DEPOT, front->tile);
InvalidateWindowClassesData(GetWindowClassForVehicleType(v->type), 0);
@@ -565,6 +569,8 @@ CommandCost CmdStartStopVehicle(TileIndex tile, DoCommandFlag flags, uint32 p1,
SetWindowWidgetDirty(WC_VEHICLE_VIEW, v->index, WID_VV_START_STOP);
SetWindowDirty(WC_VEHICLE_DEPOT, v->tile);
SetWindowClassesDirty(GetWindowClassForVehicleType(v->type));
+
+ v->MarkSeparationInvalid();
}
return CommandCost();
}