summaryrefslogtreecommitdiff
path: root/saveload.c
diff options
context:
space:
mode:
authortruelight <truelight@openttd.org>2005-02-06 10:24:57 +0000
committertruelight <truelight@openttd.org>2005-02-06 10:24:57 +0000
commit020c1e9b6c228ee812ed85ecc02dc52847940821 (patch)
tree6c6585bdaca582be23e16326cdd45058a6e3a17f /saveload.c
parente9c93f9c0ca76117ac1315b6aff03f1f138f62e4 (diff)
downloadopenttd-020c1e9b6c228ee812ed85ecc02dc52847940821.tar.xz
(svn r1818) -Add: Dynamic orders (up to 64k orders)
Diffstat (limited to 'saveload.c')
-rw-r--r--saveload.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/saveload.c b/saveload.c
index d5fabd7cc..f4902c5f4 100644
--- a/saveload.c
+++ b/saveload.c
@@ -941,7 +941,11 @@ static void *IntToReference(uint r, uint t)
return NULL;
switch (t) {
- case REF_ORDER: return GetOrder(r - 1);
+ case REF_ORDER: {
+ if (!AddBlockIfNeeded(&_order_pool, r - 1))
+ error("Orders: failed loading savegame: too many orders");
+ return GetOrder(r - 1);
+ }
case REF_VEHICLE: {
if (!AddBlockIfNeeded(&_vehicle_pool, r - 1))
error("Vehicles: failed loading savegame: too many vehicles");
@@ -959,7 +963,7 @@ static void *IntToReference(uint r, uint t)
}
case REF_ROADSTOPS: {
if (!AddBlockIfNeeded(&_roadstop_pool, r - 1))
- error("RoadStop: failed loading savegame: too many RoadStops");
+ error("RoadStops: failed loading savegame: too many RoadStops");
return GetRoadStop(r - 1);
}