diff src/depot_gui.cpp @ 6773:746c984c2dfe draft

(svn r10009) -Codechange: Add and use Vehicle::IsPrimaryVehicle to replace individual checks depending on the vehicle type.
author maedhros <maedhros@openttd.org>
date Fri, 01 Jun 2007 12:03:10 +0000
parents 5479975c4e36
children 0005a9ed1903
line wrap: on
line diff
--- a/src/depot_gui.cpp
+++ b/src/depot_gui.cpp
@@ -488,10 +488,10 @@
 
 	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) {