src/order_gui.cpp
branchnoai
changeset 9625 3301b1b3889c
parent 9601 b499fdd106d5
child 7290 647d6416cdfe
child 9626 79f2b5a0cdd7
equal deleted inserted replaced
9624:b71483f2330f 9625:3301b1b3889c
   318 
   318 
   319 static bool HandleOrderVehClick(const Vehicle *v, const Vehicle *u, Window *w)
   319 static bool HandleOrderVehClick(const Vehicle *v, const Vehicle *u, Window *w)
   320 {
   320 {
   321 	if (u->type != v->type) return false;
   321 	if (u->type != v->type) return false;
   322 
   322 
   323 	if (u->type == VEH_TRAIN && !IsFrontEngine(u)) {
   323 	if (u->HasFront() && !u->IsPrimaryVehicle()) {
   324 		u = GetFirstVehicleInChain(u);
   324 		u = GetFirstVehicleInChain(u);
   325 		if (!IsFrontEngine(u)) return false;
   325 		if (!u->IsPrimaryVehicle()) return false;
   326 	}
   326 	}
   327 
   327 
   328 	// v is vehicle getting orders. Only copy/clone orders if vehicle doesn't have any orders yet
   328 	// v is vehicle getting orders. Only copy/clone orders if vehicle doesn't have any orders yet
   329 	// obviously if you press CTRL on a non-empty orders vehicle you know what you are doing
   329 	// obviously if you press CTRL on a non-empty orders vehicle you know what you are doing
   330 	if (v->num_orders != 0 && _ctrl_pressed == 0) return false;
   330 	if (v->num_orders != 0 && _ctrl_pressed == 0) return false;