Skip to content

Commit

Permalink
cleo path is relative (#193)
Browse files Browse the repository at this point in the history
  • Loading branch information
x87 authored Sep 15, 2024
1 parent 9670d55 commit 3f917f1
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions source/CScriptEngine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -708,12 +708,15 @@ namespace CLEO
if(customWorkDir != nullptr)
fsPath = ResolvePath(customWorkDir) / fsPath;
else
{
if (Filepath_Root.compare(GetWorkDir()) != 0) // ModLoader support: do not expand game dir relative paths
{
fsPath = GetWorkDir() / fsPath;
}
}
fsPath = GetWorkDir() / fsPath;

auto resolved = FS::weakly_canonical(fsPath).string();

// ModLoader support: do not expand game dir relative paths
if (resolved.find(Filepath_Root) == 0)
return FS::relative(resolved, Filepath_Root).string();
else
return resolved;
}

return FS::weakly_canonical(fsPath).string();
Expand Down

0 comments on commit 3f917f1

Please sign in to comment.