summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2013-11-25 11:08:21 +0000
committerrubidium <rubidium@openttd.org>2013-11-25 11:08:21 +0000
commit18beaac57180d3b3020ec34e318c7d7aa805fd12 (patch)
tree9e42591deb10e0201becf8fa4e19a84181f490f3
parent573f6dcd340c4a2d0b66580f4ca2794dd9ddb0ac (diff)
downloadopenttd-18beaac57180d3b3020ec34e318c7d7aa805fd12.tar.xz
(svn r26101) -Fix: NULL pointer dereference when one can't allocate an order list but wants to make implicit orders
-rw-r--r--src/vehicle.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/vehicle.cpp b/src/vehicle.cpp
index 6a25d080b..2037da7cd 100644
--- a/src/vehicle.cpp
+++ b/src/vehicle.cpp
@@ -2012,8 +2012,7 @@ void Vehicle::BeginLoading()
}
}
} else if (!suppress_implicit_orders &&
- ((this->orders.list == NULL && OrderList::CanAllocateItem()) ||
- this->orders.list->GetNumOrders() < MAX_VEH_ORDER_ID) &&
+ ((this->orders.list == NULL ? OrderList::CanAllocateItem() : this->orders.list->GetNumOrders() < MAX_VEH_ORDER_ID)) &&
Order::CanAllocateItem()) {
/* Insert new implicit order */
Order *implicit_order = new Order();