summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authoryexo <yexo@openttd.org>2011-02-10 13:17:24 +0000
committeryexo <yexo@openttd.org>2011-02-10 13:17:24 +0000
commit421ba1c3421d11ea62438c14e47591a3360948d7 (patch)
tree345cf763b99b49e69aa7695ce3506c0fa2024d14 /src
parentb7713a7e8540aaf8d1181be8535132ba561f4364 (diff)
downloadopenttd-421ba1c3421d11ea62438c14e47591a3360948d7.tar.xz
(svn r22047) -Fix: selling a vehicle triggered the assert added in r22041
Diffstat (limited to 'src')
-rw-r--r--src/order_backup.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/order_backup.cpp b/src/order_backup.cpp
index 78091d97b..9632fa3e1 100644
--- a/src/order_backup.cpp
+++ b/src/order_backup.cpp
@@ -111,7 +111,9 @@ void OrderBackup::DoRestore(Vehicle *v)
FOR_ALL_ORDER_BACKUPS(ob) {
if (ob->user == user) delete ob;
}
- new OrderBackup(v, user);
+ if (OrderBackup::CanAllocateItem()) {
+ new OrderBackup(v, user);
+ }
}
/**