src/order_cmd.cpp
branchnoai
changeset 9732 f8eb3e208514
parent 9724 b39bc69bb2f2
child 9800 ab08ca2a2018
equal deleted inserted replaced
9731:9b1552d0fd9b 9732:f8eb3e208514
   326 
   326 
   327 	if (sel_ord > v->num_orders) return CMD_ERROR;
   327 	if (sel_ord > v->num_orders) return CMD_ERROR;
   328 
   328 
   329 	if (!HasOrderPoolFree(1)) return_cmd_error(STR_8831_NO_MORE_SPACE_FOR_ORDERS);
   329 	if (!HasOrderPoolFree(1)) return_cmd_error(STR_8831_NO_MORE_SPACE_FOR_ORDERS);
   330 
   330 
   331 	if (v->type == VEH_SHIP &&
   331 	if (v->type == VEH_SHIP && IsHumanPlayer(v->owner) && _patches.pathfinder_for_ships != VPF_NPF) {
   332 			IsHumanPlayer(v->owner) &&
   332 		/* Make sure the new destination is not too far away from the previous */
   333 			!_patches.new_pathfinding_all) {
       
   334 		// Make sure the new destination is not too far away from the previous
       
   335 		const Order *prev = NULL;
   333 		const Order *prev = NULL;
   336 		uint n = 0;
   334 		uint n = 0;
   337 
   335 
   338 		/* Find the last goto station or depot order before the insert location.
   336 		/* Find the last goto station or depot order before the insert location.
   339 		 * If the order is to be inserted at the beginning of the order list this
   337 		 * If the order is to be inserted at the beginning of the order list this