(svn r23131) -Fix (r16165): AIOrder::IsCurrentOrderPartOfOrderList return false for valid vehicles and crashed for invalid ones

pull/155/head
yexo 13 years ago
parent 7f7cab9ec5
commit 59b9c4f6f3

@ -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;

Loading…
Cancel
Save