(svn r10009) -Codechange: Add and use Vehicle::IsPrimaryVehicle to replace individual checks depending on the vehicle type.

This commit is contained in:
maedhros
2007-06-01 12:03:10 +00:00
parent ab8503f5a5
commit 4acf3e4c3f
10 changed files with 31 additions and 33 deletions

View File

@@ -320,9 +320,9 @@ static bool HandleOrderVehClick(const Vehicle *v, const Vehicle *u, Window *w)
{
if (u->type != v->type) return false;
if (u->type == VEH_TRAIN && !IsFrontEngine(u)) {
if (u->HasFront() && !u->IsPrimaryVehicle()) {
u = GetFirstVehicleInChain(u);
if (!IsFrontEngine(u)) return false;
if (!u->IsPrimaryVehicle()) return false;
}
// v is vehicle getting orders. Only copy/clone orders if vehicle doesn't have any orders yet