From 4b1cf485e0fe1727669fc8f429bf88f78c7db46b Mon Sep 17 00:00:00 2001 From: Ovahlord Date: Fri, 20 Oct 2023 15:53:46 +0200 Subject: [PATCH] Tools/MapExtractor: fixed dbc/db2 extraction under linux clses #426 --- src/tools/map_extractor/System.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/tools/map_extractor/System.cpp b/src/tools/map_extractor/System.cpp index fcf0a3c4a1..d6d5988433 100644 --- a/src/tools/map_extractor/System.cpp +++ b/src/tools/map_extractor/System.cpp @@ -1122,6 +1122,7 @@ void ExtractDBCFiles(int locale) printf("locale %s output path %s\n", localeNames[MpqToWowLocale[locale]], localePath.string().c_str()); + std::string fileName; do { if (!SFileOpenFileEx(LocaleMpq, foundFile.cFileName, SFILE_OPEN_PATCHED_FILE, &dbcFile)) @@ -1130,7 +1131,10 @@ void ExtractDBCFiles(int locale) continue; } - boost::filesystem::path filePath = localePath / boost::filesystem::path(foundFile.cFileName).filename(); + fileName = foundFile.cFileName; + fileName = fileName.substr(fileName.rfind('\\') + 1); + + boost::filesystem::path filePath = localePath / boost::filesystem::path(fileName).filename(); if (!boost::filesystem::exists(filePath)) if (ExtractFile(dbcFile, filePath.string())) @@ -1160,6 +1164,7 @@ void ExtractDB2Files(int locale) printf("locale %s output path %s\n", localeNames[MpqToWowLocale[locale]], localePath.string().c_str()); + std::string fileName; do { if (!SFileOpenFileEx(LocaleMpq, foundFile.cFileName, SFILE_OPEN_PATCHED_FILE, &dbcFile)) @@ -1168,7 +1173,10 @@ void ExtractDB2Files(int locale) continue; } - boost::filesystem::path filePath = localePath / boost::filesystem::path(foundFile.cFileName).filename(); + fileName = foundFile.cFileName; + fileName = fileName.substr(fileName.rfind('\\') + 1); + + boost::filesystem::path filePath = localePath / boost::filesystem::path(fileName).filename(); if (!boost::filesystem::exists(filePath)) if (ExtractFile(dbcFile, filePath.string()))