src/order_cmd.cpp
changeset 9978 4c10b20eaf54
parent 9977 91adacb0591d
child 10015 2b721243365f
equal deleted inserted replaced
9977:91adacb0591d 9978:4c10b20eaf54
   440 			if (v->type != VEH_TRAIN) return CMD_ERROR;
   440 			if (v->type != VEH_TRAIN) return CMD_ERROR;
   441 
   441 
   442 			if (!IsValidWaypointID(new_order.GetDestination())) return CMD_ERROR;
   442 			if (!IsValidWaypointID(new_order.GetDestination())) return CMD_ERROR;
   443 			const Waypoint *wp = GetWaypoint(new_order.GetDestination());
   443 			const Waypoint *wp = GetWaypoint(new_order.GetDestination());
   444 
   444 
   445 			if (!CheckOwnership(GetTileOwner(wp->xy))) return CMD_ERROR;
   445 			if (!CheckOwnership(wp->owner)) return CMD_ERROR;
   446 
   446 
   447 			/* Order flags can be any of the following for waypoints:
   447 			/* Order flags can be any of the following for waypoints:
   448 			 * [non-stop]
   448 			 * [non-stop]
   449 			 * non-stop orders (if any) are only valid for trains */
   449 			 * non-stop orders (if any) are only valid for trains */
   450 			if (new_order.GetNonStopType() != ONSF_STOP_EVERYWHERE && v->type != VEH_TRAIN) return CMD_ERROR;
   450 			if (new_order.GetNonStopType() != ONSF_STOP_EVERYWHERE && v->type != VEH_TRAIN) return CMD_ERROR;