diff options
author | celestar <celestar@openttd.org> | 2005-01-29 19:41:44 +0000 |
---|---|---|
committer | celestar <celestar@openttd.org> | 2005-01-29 19:41:44 +0000 |
commit | 752b3f0dd614217d68f361e2d0b2cc599a37c860 (patch) | |
tree | fcefcecfa2ec7dd8e9178d5206788bd62dcf3c53 /saveload.c | |
parent | 885fd2b15c1ae9a1422f82b8bcdd9d1a287c3aa6 (diff) | |
download | openttd-752b3f0dd614217d68f361e2d0b2cc599a37c860.tar.xz |
(svn r1721) -Feature: It is now possible to build multiple road stations (up to 8) on
a single station.
Thanks to: Truelight for the saveload code, Darkvater and Hackykid for
network testing and Tron for proof-reading 1500 lines of diff.
Diffstat (limited to 'saveload.c')
-rw-r--r-- | saveload.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/saveload.c b/saveload.c index deeedbb8c..580665c49 100644 --- a/saveload.c +++ b/saveload.c @@ -7,8 +7,8 @@ #include "saveload.h" enum { - SAVEGAME_MAJOR_VERSION = 5, - SAVEGAME_MINOR_VERSION = 2, + SAVEGAME_MAJOR_VERSION = 6, + SAVEGAME_MINOR_VERSION = 0, SAVEGAME_LOADABLE_VERSION = (SAVEGAME_MAJOR_VERSION << 8) + SAVEGAME_MINOR_VERSION }; @@ -918,6 +918,10 @@ static uint ReferenceToInt(void *v, uint t) case REF_TOWN: return ((Town *)v)->index + 1; case REF_ORDER: return ((Order *)v)->index + 1; + case REF_ROADSTOPS: + //return ((byte*)v - (byte*)_roadstops) / sizeof(_roadstops[0]) + 1; + return (RoadStop *)v - _roadstops + 1; + default: NOT_REACHED(); } @@ -942,6 +946,9 @@ static void *IntToReference(uint r, uint t) case REF_STATION: return GetStation(r - 1); case REF_TOWN: return GetTown(r - 1); + case REF_ROADSTOPS: + //return (byte*)_roadstops + (r - 1) * sizeof(_roadstops[0]); + return &_roadstops[r - 1]; case REF_VEHICLE_OLD: { /* Old vehicles were saved differently: invalid vehicle was 0xFFFF, and the index was not - 1.. correct for this */ |