diff options
author | truelight <truelight@openttd.org> | 2005-02-01 18:32:01 +0000 |
---|---|---|
committer | truelight <truelight@openttd.org> | 2005-02-01 18:32:01 +0000 |
commit | 777dd99585ca5a775cd189eedd81e27d3ca395ed (patch) | |
tree | b7d40aab99c9bff1a5304e4659c8cc7748b8a881 /saveload.c | |
parent | 6d5fdc2b6883f3522ccd0d4fa49e5855c5c70f79 (diff) | |
download | openttd-777dd99585ca5a775cd189eedd81e27d3ca395ed.tar.xz |
(svn r1764) -Add: dynamic towns, you can now have up to 64k towns (let me know when
you have that amount of towns in a map ;))
Diffstat (limited to 'saveload.c')
-rw-r--r-- | saveload.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/saveload.c b/saveload.c index 54931a2bb..6378ea0ff 100644 --- a/saveload.c +++ b/saveload.c @@ -944,7 +944,11 @@ static void *IntToReference(uint r, uint t) case REF_ORDER: return GetOrder(r - 1); case REF_VEHICLE: return GetVehicle(r - 1); case REF_STATION: return GetStation(r - 1); - case REF_TOWN: return GetTown(r - 1); + case REF_TOWN: { + if (!AddBlockIfNeeded(&_town_pool, r - 1)) + error("Towns: failed loading savegame: too many towns"); + return GetTown(r - 1); + } case REF_ROADSTOPS: //return (byte*)_roadstops + (r - 1) * sizeof(_roadstops[0]); |