diff options
| author | Shauren <shauren.trinity@gmail.com> | 2020-05-07 14:39:40 +0200 |
|---|---|---|
| committer | Shauren <shauren.trinity@gmail.com> | 2020-05-07 14:39:40 +0200 |
| commit | ea812fec1153280b94d2fff8bdefd678e86bddeb (patch) | |
| tree | cd7d75fc98ab6cc2c975fe4db9be67ccb87f40c1 /src/tools/map_extractor | |
| parent | dfdabdb97bdd776da4add3cd4f19cf5793160abf (diff) | |
Dep/CascLib: Update to ladislav-zezula/CascLib@0a05c59eb8a3eab1bc5471f43934cd5f992f0aca
Diffstat (limited to 'src/tools/map_extractor')
| -rw-r--r-- | src/tools/map_extractor/System.cpp | 2 | ||||
| -rw-r--r-- | src/tools/map_extractor/loadlib.cpp | 16 |
2 files changed, 9 insertions, 9 deletions
diff --git a/src/tools/map_extractor/System.cpp b/src/tools/map_extractor/System.cpp index 05e0867daa5..99c2ac3f5c6 100644 --- a/src/tools/map_extractor/System.cpp +++ b/src/tools/map_extractor/System.cpp @@ -1425,7 +1425,7 @@ uint32 GetInstalledLocalesMask() try { boost::filesystem::path const storage_dir(boost::filesystem::canonical(input_path) / "Data"); - CASC::StorageHandle storage = CASC::OpenStorage(storage_dir, 0, CONF_Product); + CASC::StorageHandle storage = CASC::OpenStorage(storage_dir, CASC_LOCALE_ALL_WOW, CONF_Product); if (!storage) return false; diff --git a/src/tools/map_extractor/loadlib.cpp b/src/tools/map_extractor/loadlib.cpp index 07f14ebbf84..fa6ac16edae 100644 --- a/src/tools/map_extractor/loadlib.cpp +++ b/src/tools/map_extractor/loadlib.cpp @@ -24,7 +24,7 @@ u_map_fcc MverMagic = { { 'R','E','V','M' } }; ChunkedFile::ChunkedFile() { - data = 0; + data = nullptr; data_size = 0; } @@ -36,7 +36,7 @@ ChunkedFile::~ChunkedFile() bool ChunkedFile::loadFile(CASC::StorageHandle const& mpq, std::string const& fileName, bool log) { free(); - CASC::FileHandle file = CASC::OpenFile(mpq, fileName.c_str(), CASC_LOCALE_ALL, log); + CASC::FileHandle file = CASC::OpenFile(mpq, fileName.c_str(), CASC_LOCALE_ALL_WOW, log); if (!file) return false; @@ -63,7 +63,7 @@ bool ChunkedFile::loadFile(CASC::StorageHandle const& mpq, std::string const& fi bool ChunkedFile::loadFile(CASC::StorageHandle const& mpq, uint32 fileDataId, std::string const& description, bool log) { free(); - CASC::FileHandle file = CASC::OpenFile(mpq, fileDataId, CASC_LOCALE_ALL, log); + CASC::FileHandle file = CASC::OpenFile(mpq, fileDataId, CASC_LOCALE_ALL_WOW, log); if (!file) return false; @@ -104,13 +104,13 @@ bool ChunkedFile::prepareLoadedData() void ChunkedFile::free() { - for (auto chunk : chunks) + for (auto& chunk : chunks) delete chunk.second; chunks.clear(); delete[] data; - data = 0; + data = nullptr; data_size = 0; } @@ -171,12 +171,12 @@ FileChunk* ChunkedFile::GetChunk(std::string const& name) if (std::distance(range.first, range.second) == 1) return range.first->second; - return NULL; + return nullptr; } FileChunk::~FileChunk() { - for (auto subchunk : subchunks) + for (auto& subchunk : subchunks) delete subchunk.second; subchunks.clear(); @@ -215,5 +215,5 @@ FileChunk* FileChunk::GetSubChunk(std::string const& name) if (std::distance(range.first, range.second) == 1) return range.first->second; - return NULL; + return nullptr; } |
