Fix #6574 #6636 #5405 #6493: Aircraft hangar issues #6925
Code-wise this looks fine, but I don't know enough about the code to know whether these are the correct solutions or if it's what's desired. A couple of things:
Can you elaborate on why the fix for #5405 is necessary, when it was supposedly fixed already?
Also, it would be really nice if you could merge the compiler warnings commit into which ever commit caused the warning - the changes are small enough that this is probably easiest to achieve with some manual commit editing - interactive rebase, "pick" the necessary commits & amend them
When replacing an airport with another, cancel current orders of type 'go to depot' from aircraft still heading to it if the rebuilt airport doesn't have a hangar (helicopter vs heliport), or if the airplane can't land on the rebuilt airport (airplane vs helistation). Removes 'go to hangar' orders from all aircraft when replacing an airport with hangar with another without hangar (heliport).
…kipping to a go to hangar order When manually skipping to a 'go to hangar' order in the order list, while the aircraft is flying, direct the aircraft to the correct location of the hangar.
…next destinations and then ensure these are within range of each other This fix is to avoid out of range when using service at nearest hangar orders
…ft at a hangar outside the order list If a helicopter needs to be sent to a hangar during automatic service, and there are no airports with hangars in the orders (travelling between heliports), a nearby hangar outside the orders will be searched. If the distance to a found hangar is shorter than the distance to the helistation/airport the helicopter is headed to, the helicopter is sent to that hangar.
…d or when no_servicing_if_no_breakdowns is disabled Helicopters with 'service at helipads' enabled, will only do so when 'disable servicing when servicing set to none' is disabled, or, if enabled, when 'vehicle breakdowns' is not set to none.
…dingReplace In order to verify if a helicopter with service at helipad has a pending replace, it's needed to call HasPendingReplace directly, as a seperate function that can be used by some aircraft_cmd.cpp functions
…pending replace Check if an airplane needs automatic servicing or if a helicopter has a pending replace and send it to hangar before sending to takeoff This replaces the old method which was attempting to do the same, but was ultimately canceling automatic servicing orders upon landing.
…n checks Results in less detours when handling aircraft heading to unreachable stations, such as airplanes trying to service at helistations