mirror of https://github.com/OpenTTD/OpenTTD
(svn r4116) -Fix: The AI should send a plane into a hangar if it's not in a hangar _or_ not stopped, not when it's not in a hangar _and_ not stopped
parent
1b6ed11d7b
commit
95adeec127
|
@ -359,7 +359,7 @@ static void AiHandleReplaceAircraft(Player *p)
|
||||||
BackuppedOrders orderbak[1];
|
BackuppedOrders orderbak[1];
|
||||||
EngineID veh;
|
EngineID veh;
|
||||||
|
|
||||||
if (!IsAircraftHangarTile(v->tile) && !(v->vehstatus&VS_STOPPED)) {
|
if (!IsAircraftHangarTile(v->tile) || !(v->vehstatus&VS_STOPPED)) {
|
||||||
AiHandleGotoDepot(p, CMD_SEND_AIRCRAFT_TO_HANGAR);
|
AiHandleGotoDepot(p, CMD_SEND_AIRCRAFT_TO_HANGAR);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -3504,7 +3504,7 @@ static void AiStateSellVeh(Player *p)
|
||||||
|
|
||||||
DoCommandByTile(0, v->index, 0, DC_EXEC, CMD_SELL_ROAD_VEH);
|
DoCommandByTile(0, v->index, 0, DC_EXEC, CMD_SELL_ROAD_VEH);
|
||||||
} else if (v->type == VEH_Aircraft) {
|
} else if (v->type == VEH_Aircraft) {
|
||||||
if (!IsAircraftHangarTile(v->tile) && !(v->vehstatus&VS_STOPPED)) {
|
if (!IsAircraftHangarTile(v->tile) || !(v->vehstatus & VS_STOPPED)) {
|
||||||
if (v->current_order.type != OT_GOTO_DEPOT)
|
if (v->current_order.type != OT_GOTO_DEPOT)
|
||||||
DoCommandByTile(0, v->index, 0, DC_EXEC, CMD_SEND_AIRCRAFT_TO_HANGAR);
|
DoCommandByTile(0, v->index, 0, DC_EXEC, CMD_SEND_AIRCRAFT_TO_HANGAR);
|
||||||
goto going_to_depot;
|
goto going_to_depot;
|
||||||
|
|
Loading…
Reference in New Issue