[mod] Check for files in mod dir at the end.

This commit is contained in:
lzwdgc 2024-06-07 02:02:36 +03:00
parent fa51a58111
commit 3096e42954

View file

@ -1401,6 +1401,10 @@ FF D7 ; call edi
} }
auto p = find_file_in_paks(fn, "res3.pak", "res2.pak", "res0.pak"); auto p = find_file_in_paks(fn, "res3.pak", "res2.pak", "res0.pak");
if (!fs::exists(p)) { if (!fs::exists(p)) {
auto dst = get_mod_dir() / p.filename();
if (fs::exists(dst)) {
return dst;
}
throw SW_RUNTIME_ERROR("Cannot find file in archives: "s + fn.string()); throw SW_RUNTIME_ERROR("Cannot find file in archives: "s + fn.string());
} }
auto dst = get_mod_dir() / p.filename(); auto dst = get_mod_dir() / p.filename();