|
@@ -1271,13 +1271,13 @@ void HandleMissingAircraftOrders(Aircraf
|
|
|
* go to a depot, we have to keep that order so the aircraft
|
|
|
* actually stops.
|
|
|
*/
|
|
|
const Station *st = GetTargetAirportIfValid(v);
|
|
|
if (st == nullptr) {
|
|
|
Backup<CompanyID> cur_company(_current_company, v->owner, FILE_LINE);
|
|
|
CommandCost ret = DoCommand(v->tile, v->index, 0, DC_EXEC, CMD_SEND_VEHICLE_TO_DEPOT);
|
|
|
CommandCost ret = DoCommand(DC_EXEC, CMD_SEND_VEHICLE_TO_DEPOT, v->tile, v->index, 0);
|
|
|
cur_company.Restore();
|
|
|
|
|
|
if (ret.Failed()) CrashAirplane(v);
|
|
|
} else if (!v->current_order.IsType(OT_GOTO_DEPOT)) {
|
|
|
v->current_order.Free();
|
|
|
}
|
|
@@ -1634,13 +1634,13 @@ static void AircraftEventHandler_HeliTak
|
|
|
/* get the next position to go to, differs per airport */
|
|
|
AircraftNextAirportPos_and_Order(v);
|
|
|
|
|
|
/* Send the helicopter to a hangar if needed for replacement */
|
|
|
if (v->NeedsAutomaticServicing()) {
|
|
|
Backup<CompanyID> cur_company(_current_company, v->owner, FILE_LINE);
|
|
|
DoCommand(v->tile, v->index | DEPOT_SERVICE | DEPOT_LOCATE_HANGAR, 0, DC_EXEC, CMD_SEND_VEHICLE_TO_DEPOT);
|
|
|
DoCommand(DC_EXEC, CMD_SEND_VEHICLE_TO_DEPOT, v->tile, v->index | DEPOT_SERVICE | DEPOT_LOCATE_HANGAR, 0);
|
|
|
cur_company.Restore();
|
|
|
}
|
|
|
}
|
|
|
|
|
|
static void AircraftEventHandler_Flying(Aircraft *v, const AirportFTAClass *apc)
|
|
|
{
|
|
@@ -1685,13 +1685,13 @@ static void AircraftEventHandler_Landing
|
|
|
v->state = ENDLANDING;
|
|
|
AircraftLandAirplane(v); // maybe crash airplane
|
|
|
|
|
|
/* check if the aircraft needs to be replaced or renewed and send it to a hangar if needed */
|
|
|
if (v->NeedsAutomaticServicing()) {
|
|
|
Backup<CompanyID> cur_company(_current_company, v->owner, FILE_LINE);
|
|
|
DoCommand(v->tile, v->index | DEPOT_SERVICE, 0, DC_EXEC, CMD_SEND_VEHICLE_TO_DEPOT);
|
|
|
DoCommand(DC_EXEC, CMD_SEND_VEHICLE_TO_DEPOT, v->tile, v->index | DEPOT_SERVICE, 0);
|
|
|
cur_company.Restore();
|
|
|
}
|
|
|
}
|
|
|
|
|
|
static void AircraftEventHandler_HeliLanding(Aircraft *v, const AirportFTAClass *apc)
|
|
|
{
|