summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorsmatz <smatz@openttd.org>2011-02-23 00:00:50 +0000
committersmatz <smatz@openttd.org>2011-02-23 00:00:50 +0000
commit678cf3553f8d8728ac7dd43603df92a0c92952b5 (patch)
tree686043b54872aa4493abe25d5ba480fd38547a47 /src
parent58c7f5c4976c1422a08664e34485894c8e198109 (diff)
downloadopenttd-678cf3553f8d8728ac7dd43603df92a0c92952b5.tar.xz
(svn r22130) -Fix: failed assert when loading savegame with empty shared orderlist
Diffstat (limited to 'src')
-rw-r--r--src/saveload/vehicle_sl.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/saveload/vehicle_sl.cpp b/src/saveload/vehicle_sl.cpp
index 2cfc704a1..f3af88172 100644
--- a/src/saveload/vehicle_sl.cpp
+++ b/src/saveload/vehicle_sl.cpp
@@ -307,6 +307,8 @@ void AfterLoadVehicles(bool part_of_load)
FOR_ALL_VEHICLES(v) {
if (v->First() != v || v->orders.list != NULL || v->previous_shared != NULL || v->next_shared == NULL) continue;
+ /* As above, allocating OrderList here is safe. */
+ assert(OrderList::CanAllocateItem());
v->orders.list = new OrderList(NULL, v);
for (Vehicle *u = v; u != NULL; u = u->next_shared) {
u->orders.list = v->orders.list;