From dc1fd2dbe685cb15e53fea2bc5d21e196dc301e4 Mon Sep 17 00:00:00 2001 From: yexo Date: Tue, 8 Nov 2011 15:00:55 +0000 Subject: [PATCH] (svn r23131) -Fix (r16165): AIOrder::IsCurrentOrderPartOfOrderList return false for valid vehicles and crashed for invalid ones --- src/ai/api/ai_order.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ai/api/ai_order.cpp b/src/ai/api/ai_order.cpp index f02932ac2b..8757c7bebf 100644 --- a/src/ai/api/ai_order.cpp +++ b/src/ai/api/ai_order.cpp @@ -128,7 +128,7 @@ static const Order *ResolveOrder(VehicleID vehicle_id, AIOrder::OrderPosition or /* static */ bool AIOrder::IsCurrentOrderPartOfOrderList(VehicleID vehicle_id) { - if (AIVehicle::IsValidVehicle(vehicle_id)) return false; + if (!AIVehicle::IsValidVehicle(vehicle_id)) return false; if (GetOrderCount(vehicle_id) == 0) return false; const Order *order = &::Vehicle::Get(vehicle_id)->current_order;