1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-08-30 18:09:09 +00:00

(svn r26101) -Fix: NULL pointer dereference when one can't allocate an order list but wants to make implicit orders

This commit is contained in:
rubidium
2013-11-25 11:08:21 +00:00
parent 573f6dcd34
commit 18beaac571

View File

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