Skip to content

Commit

Permalink
Fix crash when trying to load default lol directory
Browse files Browse the repository at this point in the history
  • Loading branch information
Querijn Heijmans committed Dec 28, 2023
1 parent 6072e7f commit 32209b6
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -271,8 +271,13 @@ void MountDir(const char* wadPath)
sapp_desc sokol_main(int argc, char* argv[])
{
// Load current working directory and default or argument path
MountDir(argc <= 1 ? "C:/Riot Games/League of Legends/Game/DATA/FINAL" : argv[1]);
MountDir(fs::current_path().string().c_str());
const char* argumentDirectory = argc <= 1 ? "C:/Riot Games/League of Legends/Game/DATA/FINAL" : argv[1];
if (fs::exists(argumentDirectory))
MountDir(argumentDirectory);

fs::path localDirectory = fs::current_path();
if (fs::exists(localDirectory))
MountDir(localDirectory.string().c_str());

sapp_desc appDesc = {};
appDesc.init_cb = Init;
Expand Down

0 comments on commit 32209b6

Please sign in to comment.