forked from github/server
eliminate global.data_version completely
This commit is contained in:
parent
98856a8e4b
commit
db852a05fd
|
@ -1502,7 +1502,6 @@ int readgame(const char *filename, bool backup)
|
|||
fstream_init(&strm, F);
|
||||
binstore_init(&store, &strm);
|
||||
gdata.store = &store;
|
||||
global.data_version = gdata.version; /* FIXME: hack! attribute::read does not have access to gamedata, only storage */
|
||||
|
||||
if (gdata.version >= BUILDNO_VERSION) {
|
||||
int build;
|
||||
|
@ -1835,7 +1834,6 @@ int writegame(const char *filename)
|
|||
|
||||
gdata.store = &store;
|
||||
gdata.version = RELEASE_VERSION;
|
||||
global.data_version = RELEASE_VERSION; // FIXME: no code that is writing should need this
|
||||
n = STREAM_VERSION;
|
||||
fwrite(&gdata.version, sizeof(int), 1, F);
|
||||
fwrite(&n, sizeof(int), 1, F);
|
||||
|
|
|
@ -37,7 +37,6 @@ static void test_readwrite_data(CuTest * tc)
|
|||
test_cleanup();
|
||||
CuAssertIntEquals(tc, 0, writegame(filename));
|
||||
CuAssertIntEquals(tc, 0, readgame(filename, false));
|
||||
CuAssertIntEquals(tc, RELEASE_VERSION, global.data_version);
|
||||
join_path(datapath(), filename, path, sizeof(path));
|
||||
CuAssertIntEquals(tc, 0, remove(path));
|
||||
test_cleanup();
|
||||
|
@ -87,7 +86,6 @@ static void test_readwrite_attrib(CuTest *tc) {
|
|||
key_set(&a, 42);
|
||||
mstream_init(&data.strm);
|
||||
gamedata_init(&data, &store, RELEASE_VERSION);
|
||||
global.data_version = RELEASE_VERSION; // FIXME: hack!
|
||||
write_attribs(data.store, a, NULL);
|
||||
a_removeall(&a, NULL);
|
||||
CuAssertPtrEquals(tc, 0, a);
|
||||
|
|
|
@ -35,8 +35,8 @@
|
|||
#define ATTRIBOWNER_VERSION 350 /* all attrib_type functions know who owns the attribute */
|
||||
#define BADCRYPT_VERSION 351 /* passwords are encrypted, poorly */
|
||||
#define ATHASH_VERSION 352 /* attribute-type hash, not name */
|
||||
#define CRYPT_VERSION 353 /* passwords are encrypted */
|
||||
#define NOWATCH_VERSION 354 /* plane->watchers is gone */
|
||||
#define RELEASE_VERSION ATHASH_VERSION /* current datafile */
|
||||
#define NOWATCH_VERSION 353 /* plane->watchers is gone */
|
||||
#define CRYPT_VERSION 354 /* passwords are encrypted */
|
||||
#define RELEASE_VERSION NOWATCH_VERSION /* current datafile */
|
||||
#define MIN_VERSION INTPAK_VERSION /* minimal datafile we support */
|
||||
#define MAX_VERSION RELEASE_VERSION /* change this if we can need to read the future datafile, and we can do so */
|
||||
|
|
|
@ -107,7 +107,7 @@ static int createunit_read(trigger * t, gamedata *data)
|
|||
// read_reference(&td->f, store, read_faction_reference, resolve_faction);
|
||||
|
||||
read_reference(&td->r, data, read_region_reference,
|
||||
RESOLVE_REGION(global.data_version));
|
||||
RESOLVE_REGION(data->version));
|
||||
td->race = (const struct race *)read_race_reference(data->store).v;
|
||||
if (!td->race) {
|
||||
result = AT_READ_FAIL;
|
||||
|
|
Loading…
Reference in New Issue