summaryrefslogtreecommitdiff
path: root/saveload.c
diff options
context:
space:
mode:
authortruelight <truelight@openttd.org>2005-02-03 17:22:35 +0000
committertruelight <truelight@openttd.org>2005-02-03 17:22:35 +0000
commit1938a73c90db32244162a927e51c1903fed779f9 (patch)
treebe17b2ce20037210425d4757c66ffc50cccc6d77 /saveload.c
parentf1d4a85f5989e65998c326864fa59dadf9065e47 (diff)
downloadopenttd-1938a73c90db32244162a927e51c1903fed779f9.tar.xz
(svn r1776) -Add: Dynamic stations. You can now have up to 64k of stations
Diffstat (limited to 'saveload.c')
-rw-r--r--saveload.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/saveload.c b/saveload.c
index 8db82bf2c..174d65703 100644
--- a/saveload.c
+++ b/saveload.c
@@ -943,7 +943,11 @@ static void *IntToReference(uint r, uint t)
switch (t) {
case REF_ORDER: return GetOrder(r - 1);
case REF_VEHICLE: return GetVehicle(r - 1);
- case REF_STATION: return GetStation(r - 1);
+ case REF_STATION: {
+ if (!AddBlockIfNeeded(&_station_pool, r - 1))
+ error("Stations: failed loading savegame: too many stations");
+ return GetStation(r - 1);
+ }
case REF_TOWN: {
if (!AddBlockIfNeeded(&_town_pool, r - 1))
error("Towns: failed loading savegame: too many towns");