summaryrefslogtreecommitdiff
path: root/src/depot_gui.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/depot_gui.cpp')
-rw-r--r--src/depot_gui.cpp5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/depot_gui.cpp b/src/depot_gui.cpp
index 91df5b642..a311ebd75 100644
--- a/src/depot_gui.cpp
+++ b/src/depot_gui.cpp
@@ -453,10 +453,7 @@ struct DepotWindow : Window {
if (x < 0) break;
}
- /* if an articulated part was selected, find its parent */
- while (v != NULL && v->IsArticulatedPart()) v = v->Previous();
-
- d->wagon = v;
+ d->wagon = (v != NULL ? v->GetFirstEnginePart() : NULL);
return MODE_DRAG_VEHICLE;
}