Skip to content

Commit

Permalink
Update .WAD pathfinder
Browse files Browse the repository at this point in the history
  • Loading branch information
UnrealKaraulov committed Dec 17, 2023
1 parent 9cfc303 commit bad94c0
Showing 1 changed file with 10 additions and 19 deletions.
29 changes: 10 additions & 19 deletions src/editor/BspRenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -305,33 +305,24 @@ void BspRenderer::loadTextures()
for (int i = 0; i < wadNames.size(); i++)
{
std::string path = std::string();
for (int k = 0; k < tryPaths.size(); k++)
if (FindPathInAssets(map, wadNames[i], path))
{
std::string tryPath = tryPaths[k] + wadNames[i];
if (!fileExists(tryPath))
tryPath = g_game_dir + tryPaths[k] + wadNames[i];
if (fileExists(tryPath))
print_log(get_localized_string(LANG_0269), path);
Wad* wad = new Wad(path);
if (wad->readInfo())
wads.push_back(wad);
else
{
path = std::move(tryPath);
break;
print_log(get_localized_string(LANG_0270), path);
delete wad;
}
}

if (path.empty())
else if (path.empty())
{
print_log(get_localized_string(LANG_0268), wadNames[i]);
FindPathInAssets(map, wadNames[i], path, true);
continue;
}

print_log(get_localized_string(LANG_0269), path);
Wad* wad = new Wad(path);
if (wad->readInfo())
wads.push_back(wad);
else
{
print_log(get_localized_string(LANG_0270), path);
delete wad;
}
}

int wadTexCount = 0;
Expand Down

0 comments on commit bad94c0

Please sign in to comment.