summaryrefslogtreecommitdiff
path: root/src/ai
diff options
context:
space:
mode:
authoryexo <yexo@openttd.org>2011-11-08 15:00:55 +0000
committeryexo <yexo@openttd.org>2011-11-08 15:00:55 +0000
commitdc1fd2dbe685cb15e53fea2bc5d21e196dc301e4 (patch)
tree5709553c139a441da3adeec62132c24528a6c4de /src/ai
parentd5539f76d36281eab74cd7da47761324dbc34af6 (diff)
downloadopenttd-dc1fd2dbe685cb15e53fea2bc5d21e196dc301e4.tar.xz
(svn r23131) -Fix (r16165): AIOrder::IsCurrentOrderPartOfOrderList return false for valid vehicles and crashed for invalid ones
Diffstat (limited to 'src/ai')
-rw-r--r--src/ai/api/ai_order.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/ai/api/ai_order.cpp b/src/ai/api/ai_order.cpp
index f02932ac2..8757c7beb 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;