summaryrefslogtreecommitdiff
path: root/saveload.c
diff options
context:
space:
mode:
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);
}