Skip to content
This repository has been archived by the owner on Jan 18, 2024. It is now read-only.

Commit

Permalink
Tools/MapExtractor: fixed dbc/db2 extraction under linux
Browse files Browse the repository at this point in the history
clses #426
  • Loading branch information
Ovahlord authored Oct 20, 2023
1 parent cbb0274 commit 4b1cf48
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/tools/map_extractor/System.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand All @@ -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()))
Expand Down Expand Up @@ -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))
Expand All @@ -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()))
Expand Down

0 comments on commit 4b1cf48

Please sign in to comment.