From 4acf3e4c3f4aebf66b82cc1d33aab221d27d800c Mon Sep 17 00:00:00 2001 From: maedhros Date: Fri, 1 Jun 2007 12:03:10 +0000 Subject: (svn r10009) -Codechange: Add and use Vehicle::IsPrimaryVehicle to replace individual checks depending on the vehicle type. --- src/depot_gui.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/depot_gui.cpp') diff --git a/src/depot_gui.cpp b/src/depot_gui.cpp index 8aea0298c..2d1cf1b41 100644 --- a/src/depot_gui.cpp +++ b/src/depot_gui.cpp @@ -488,10 +488,10 @@ static void HandleCloneVehClick(const Vehicle *v, const Window *w) if (v == NULL) return; - if (v->type == VEH_TRAIN && !IsFrontEngine(v)) { + if (v->HasFront() && !v->IsPrimaryVehicle()) { v = GetFirstVehicleInChain(v); /* Do nothing when clicking on a train in depot with no loc attached */ - if (!IsFrontEngine(v)) return; + if (v->type == VEH_TRAIN && !IsFrontEngine(v)) return; } switch (v->type) { -- cgit v1.2.3-54-g00ecf