diff options
author | rubidium <rubidium@openttd.org> | 2013-11-25 11:08:21 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2013-11-25 11:08:21 +0000 |
commit | 18beaac57180d3b3020ec34e318c7d7aa805fd12 (patch) | |
tree | 9e42591deb10e0201becf8fa4e19a84181f490f3 /src | |
parent | 573f6dcd340c4a2d0b66580f4ca2794dd9ddb0ac (diff) | |
download | openttd-18beaac57180d3b3020ec34e318c7d7aa805fd12.tar.xz |
(svn r26101) -Fix: NULL pointer dereference when one can't allocate an order list but wants to make implicit orders
Diffstat (limited to 'src')
-rw-r--r-- | src/vehicle.cpp | 3 |
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(); |