1
0
Fork 0
mirror of https://github.com/AquariaOSE/Aquaria.git synced 2024-11-15 14:09:06 +00:00

Fix regression added in "Fix loading world map data when loading a mod's saved game" (459a41e1f6)

Loading world map data would reset the visited world map tiles.

Also little fix in savegame loading: Load mod data before reset,
so it knows we're preparing to load a mod.
This commit is contained in:
fgenesis 2012-09-02 02:27:23 +02:00
parent 9e4fe3809e
commit 3bdb0d6bc6

View file

@ -2553,12 +2553,26 @@ void Continuity::loadFileData(int slot, TiXmlDocument &doc)
void Continuity::loadFile(int slot)
{
dsq->user.save();
this->reset();
knowsSong.clear(); // Adds shield song by default, which interferes with mods that don't start with it
TiXmlDocument doc;
loadFileData(slot, doc);
TiXmlElement *startData = doc.FirstChildElement("StartData");
if (startData)
{
if (startData->Attribute("mod"))
{
#ifdef AQUARIA_DEMO
exit(-1);
#else
dsq->mod.load(startData->Attribute("mod"));
#endif
}
}
this->reset();
knowsSong.clear(); // Adds shield song by default, which interferes with mods that don't start with it
int versionMajor=-1, versionMinor=-1, versionRevision=-1;
TiXmlElement *xmlVersion = doc.FirstChildElement("Version");
if (xmlVersion)
@ -2797,7 +2811,6 @@ void Continuity::loadFile(int slot)
e2 = e2->NextSiblingElement("StringFlag");
}
TiXmlElement *startData = doc.FirstChildElement("StartData");
if (startData)
{
int x = atoi(startData->Attribute("x"));
@ -2811,15 +2824,6 @@ void Continuity::loadFile(int slot)
//dsq->continuity.naijaModel = startData->Attribute("naijaModel");
}
if (startData->Attribute("mod"))
{
#ifdef AQUARIA_DEMO
exit(-1);
#else
dsq->mod.load(startData->Attribute("mod"));
#endif
}
if (startData->Attribute("form"))
{
dsq->continuity.form = FormType(atoi(startData->Attribute("form")));
@ -2917,12 +2921,6 @@ void Continuity::loadFile(int slot)
dsq->game->sceneToLoad = startData->Attribute("scene");
//dsq->game->transitionToScene();
}
// Possibly mod-specific data the the continuity reset didn't catch
loadSongBank();
this->worldMap.load();
loadTreasureData();
stringBank.load();
}
void Continuity::setNaijaModel(std::string model)