# HG changeset patch # User yexo # Date 2011-11-08 15:00:55 # Node ID a4e7d08664db50c1539f04e67a540b172640993f # Parent d7845dfa4ba10a8badbcef68877ea35c2e275189 (svn r23131) -Fix (r16165): AIOrder::IsCurrentOrderPartOfOrderList return false for valid vehicles and crashed for invalid ones diff --git a/src/ai/api/ai_order.cpp b/src/ai/api/ai_order.cpp --- a/src/ai/api/ai_order.cpp +++ b/src/ai/api/ai_order.cpp @@ -128,7 +128,7 @@ static const Order *ResolveOrder(Vehicle /* 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;