Skip to content

Commit

Permalink
Fix current dir
Browse files Browse the repository at this point in the history
  • Loading branch information
UnrealKaraulov committed Dec 6, 2023
1 parent 91e16dd commit 0db9764
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/editor/Renderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -806,9 +806,9 @@ void Renderer::loadFgds()
}
else
{
FindPathInAssets(NULL, g_settings.fgdPaths[i].path, newFgdPath, true);
logf(get_localized_string(LANG_0910), g_settings.fgdPaths[i].path);
if (!FindPathInAssets(NULL, g_settings.fgdPaths[i].path, newFgdPath, true))
g_settings.fgdPaths[i].enabled = false;
g_settings.fgdPaths[i].enabled = false;
continue;
}
}
Expand Down
3 changes: 3 additions & 0 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,7 @@ int noclip(CommandLine& cli)
if (!cli.hasOption("-hull"))
{
logf(get_localized_string(LANG_0010));
delete map;
return 1;
}
redirect = cli.getOptionInt("-redirect");
Expand Down Expand Up @@ -458,6 +459,7 @@ int simplify(CommandLine& cli)
if (hull < 1 || hull >= MAX_MAP_HULLS)
{
logf(get_localized_string(LANG_0024));
delete map;
return 1;
}
}
Expand Down Expand Up @@ -585,6 +587,7 @@ int transform(CommandLine& cli)
delete map;
return 0;
}
delete map;
return 1;
}

Expand Down
10 changes: 5 additions & 5 deletions src/util/util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1493,14 +1493,14 @@ void FixupAllSystemPaths()
fixupPath(g_settings.gamedir, FIXUPPATH_SLASH::FIXUPPATH_SLASH_SKIP, FIXUPPATH_SLASH::FIXUPPATH_SLASH_CREATE);
if (!dirExists(g_settings.gamedir))
{
if (!dirExists(g_current_dir + g_settings.gamedir))
if (!dirExists(GetCurrentDir() + g_settings.gamedir))
{
logf("Error{}: Gamedir {} not exits!", "[1]", g_settings.gamedir);
logf("Error{}: Gamedir {} not exits!", "[2]", g_current_dir + g_settings.gamedir);
logf("Error{}: Gamedir {} not exits!", "[2]", GetCurrentDir() + g_settings.gamedir);
}
else
{
g_game_dir = g_current_dir + g_settings.gamedir;
g_game_dir = GetCurrentDir() + g_settings.gamedir;
}
}
else
Expand All @@ -1518,7 +1518,7 @@ void FixupAllSystemPaths()
*/
fixupPath(g_settings.workingdir, FIXUPPATH_SLASH::FIXUPPATH_SLASH_REMOVE, FIXUPPATH_SLASH::FIXUPPATH_SLASH_CREATE);

if (!dirExists(g_current_dir + g_settings.workingdir))
if (!dirExists(GetCurrentDir() + g_settings.workingdir))
{
if (!dirExists(g_game_dir + g_settings.workingdir))
{
Expand All @@ -1532,7 +1532,7 @@ void FixupAllSystemPaths()
}
else
{
g_working_dir = g_current_dir + g_settings.workingdir;
g_working_dir = GetCurrentDir() + g_settings.workingdir;
}
}
else
Expand Down

0 comments on commit 0db9764

Please sign in to comment.