From 26c10adbfce56a9f664d54ba91937846605ee241 Mon Sep 17 00:00:00 2001 From: bjarni Date: Fri, 1 Sep 2006 12:37:03 +0000 Subject: (svn r6295) -Feature: using goto depot with a different control selection will now alter the service/stopping in depot flag instead of cancelling the goto depot order --- aircraft_cmd.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'aircraft_cmd.c') diff --git a/aircraft_cmd.c b/aircraft_cmd.c index 26a9bc85f..5ffa59faf 100644 --- a/aircraft_cmd.c +++ b/aircraft_cmd.c @@ -512,6 +512,17 @@ int32 CmdSendAircraftToHangar(TileIndex tile, uint32 flags, uint32 p1, uint32 p2 if (v->type != VEH_Aircraft || !CheckOwnership(v->owner)) return CMD_ERROR; if (v->current_order.type == OT_GOTO_DEPOT && !(p2 & DEPOT_LOCATE_HANGAR)) { + if ((p2 & DEPOT_SERVICE) == (bool)HASBIT(v->current_order.flags, OFB_HALT_IN_DEPOT)) { + /* We called with a different DEPOT_SERVICE setting. + * Now we change the setting to apply the new one and let the vehicle head for the same hangar. + * Note: the if is (true for requesting service == true for ordered to stop in hangar) */ + if (flags & DC_EXEC) { + TOGGLEBIT(v->current_order.flags, OFB_HALT_IN_DEPOT); + InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, STATUS_BAR); + } + return 0; + } + if (p2 & DEPOT_DONT_CANCEL) return CMD_ERROR; // Requested no cancelation of hangar orders if (flags & DC_EXEC) { if (v->current_order.flags & OF_UNLOAD) v->cur_order_index++; -- cgit v1.2.3-70-g09d2