Noggit3 : extendable array: prevent use after extend

https://github.com/wowdev/noggit3/pull/91
+ adspartan mapchunk: store pointer to the header when saving f7e5f8396f
This commit is contained in:
T1ti
2024-08-31 05:35:09 +02:00
parent 2c3c98add7
commit 61b607bb5c
17 changed files with 231 additions and 113 deletions

View File

@@ -190,7 +190,7 @@ void MapIndex::save()
//Log << "Saving WDT \"" << filename << "\"." << std::endl;
sExtendableArray wdtFile = sExtendableArray();
util::sExtendableArray wdtFile;
int curPos = 0;
// MVER
@@ -266,7 +266,7 @@ void MapIndex::save()
BlizzardArchive::ClientFile f(filename.str(), Noggit::Application::NoggitApplication::instance()->clientData(),
BlizzardArchive::ClientFile::NEW_FILE);
f.setBuffer(wdtFile.data);
f.setBuffer(wdtFile.all_data());
f.save();
f.close();
@@ -1240,7 +1240,7 @@ void MapIndex::create_empty_wdl() const
filename << "World\\Maps\\" << basename << "\\" << basename << ".wdl"; // mapIndex.basename ?
//Log << "Saving WDL \"" << filename << "\"." << std::endl;
sExtendableArray wdlFile = sExtendableArray();
util::sExtendableArray wdlFile;
int curPos = 0;
// MVER
@@ -1340,7 +1340,7 @@ void MapIndex::create_empty_wdl() const
BlizzardArchive::ClientFile f(filename.str(), Noggit::Application::NoggitApplication::instance()->clientData(),
BlizzardArchive::ClientFile::NEW_FILE);
f.setBuffer(wdlFile.data);
f.setBuffer(wdlFile.all_data());
f.save();
f.close();
}