forked from github/server
remove global.data_version where gamedata.version is available
github issue #479
This commit is contained in:
parent
2d30d4cce6
commit
21aee8ece8
|
@ -419,11 +419,12 @@ void read_items(struct storage *store, item ** ilist)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void read_alliances(struct storage *store)
|
static void read_alliances(struct gamedata *data)
|
||||||
{
|
{
|
||||||
|
storage *store = data->store;
|
||||||
char pbuf[8];
|
char pbuf[8];
|
||||||
int id, terminator = 0;
|
int id, terminator = 0;
|
||||||
if (global.data_version < ALLIANCELEADER_VERSION) {
|
if (data->version < ALLIANCELEADER_VERSION) {
|
||||||
terminator = atoi36("end");
|
terminator = atoi36("end");
|
||||||
READ_STR(store, pbuf, sizeof(pbuf));
|
READ_STR(store, pbuf, sizeof(pbuf));
|
||||||
id = atoi36(pbuf);
|
id = atoi36(pbuf);
|
||||||
|
@ -436,10 +437,10 @@ static void read_alliances(struct storage *store)
|
||||||
alliance *al;
|
alliance *al;
|
||||||
READ_STR(store, aname, sizeof(aname));
|
READ_STR(store, aname, sizeof(aname));
|
||||||
al = makealliance(id, aname);
|
al = makealliance(id, aname);
|
||||||
if (global.data_version >= OWNER_2_VERSION) {
|
if (data->version >= OWNER_2_VERSION) {
|
||||||
READ_INT(store, &al->flags);
|
READ_INT(store, &al->flags);
|
||||||
}
|
}
|
||||||
if (global.data_version >= ALLIANCELEADER_VERSION) {
|
if (data->version >= ALLIANCELEADER_VERSION) {
|
||||||
read_reference(&al->_leader, store, read_faction_reference,
|
read_reference(&al->_leader, store, read_faction_reference,
|
||||||
resolve_faction);
|
resolve_faction);
|
||||||
READ_INT(store, &id);
|
READ_INT(store, &id);
|
||||||
|
@ -1591,7 +1592,7 @@ int readgame(const char *filename, bool backup)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Read factions */
|
/* Read factions */
|
||||||
read_alliances(&store);
|
read_alliances(&gdata);
|
||||||
READ_INT(&store, &nread);
|
READ_INT(&store, &nread);
|
||||||
log_debug(" - Einzulesende Parteien: %d\n", nread);
|
log_debug(" - Einzulesende Parteien: %d\n", nread);
|
||||||
fp = &factions;
|
fp = &factions;
|
||||||
|
|
|
@ -81,7 +81,7 @@ static int gate_read(trigger * t, gamedata *data)
|
||||||
read_reference(&gd->gate, data->store, read_building_reference, resolve_building);
|
read_reference(&gd->gate, data->store, read_building_reference, resolve_building);
|
||||||
int rc =
|
int rc =
|
||||||
read_reference(&gd->target, data->store, read_region_reference,
|
read_reference(&gd->target, data->store, read_region_reference,
|
||||||
RESOLVE_REGION(global.data_version));
|
RESOLVE_REGION(data->version));
|
||||||
|
|
||||||
if (bc == 0 && rc == 0) {
|
if (bc == 0 && rc == 0) {
|
||||||
if (!gd->gate || !gd->target)
|
if (!gd->gate || !gd->target)
|
||||||
|
|
Loading…
Reference in New Issue