1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-08-28 17:09:10 +00:00

(svn r5279) -Backport: 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
This commit is contained in:
tron
2006-06-15 14:16:57 +00:00
parent 12a68cc7c3
commit af0354ad24

View File

@@ -351,7 +351,7 @@ static void AiHandleReplaceAircraft(Player *p)
BackuppedOrders orderbak[1];
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);
return;
}
@@ -3575,7 +3575,7 @@ static void AiStateSellVeh(Player *p)
DoCommandByTile(0, v->index, 0, DC_EXEC, CMD_SELL_ROAD_VEH);
} 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)
DoCommandByTile(0, v->index, 0, DC_EXEC, CMD_SEND_AIRCRAFT_TO_HANGAR);
goto going_to_depot;