(svn r14830) -Fix [FS#2495]: overflow of number of orders per vehicle (based on patch by Swallow)

This commit is contained in:
rubidium
2009-01-04 15:53:43 +00:00
parent 9658c83a33
commit e557c88667
2 changed files with 6 additions and 3 deletions

View File

@@ -567,6 +567,7 @@ CommandCost CmdInsertOrder(TileIndex tile, uint32 flags, uint32 p1, uint32 p2, c
if (sel_ord > v->GetNumOrders()) return CMD_ERROR;
if (v->GetNumOrders() >= MAX_VEH_ORDER_ID) return_cmd_error(STR_8832_TOO_MANY_ORDERS);
if (!Order::CanAllocateItem()) return_cmd_error(STR_8831_NO_MORE_SPACE_FOR_ORDERS);
if (v->orders.list == NULL && !OrderList::CanAllocateItem()) return_cmd_error(STR_8831_NO_MORE_SPACE_FOR_ORDERS);