Skip to content

Commit

Permalink
Normalize MPQ paths when looking for alpha data files
Browse files Browse the repository at this point in the history
  • Loading branch information
namreeb committed Jul 24, 2024
1 parent f311d60 commit 7b547ba
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion parser/MpqManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,12 @@ MpqManager::OpenFile(const std::string& file)

for (auto const& i : MpqHandles)
{
if (i.first != file_lower)
// if we are on Linux, the mpq filenames will use forward slashes
// instead of backslashes. this code could be cleaner.
std::string mpqPath = i.first;
std::replace(mpqPath.begin(), mpqPath.end(), '/', '\\');

if (mpqPath != file_lower)
continue;

// if we have found a match, there should be exactly two files in this
Expand Down

0 comments on commit 7b547ba

Please sign in to comment.