Skip to content

Commit

Permalink
Try to find game data from the working directory too
Browse files Browse the repository at this point in the history
  • Loading branch information
jyrkive committed Jan 20, 2016
1 parent 702be57 commit 6d82f98
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/wesnoth.cpp
Expand Up @@ -1033,6 +1033,12 @@ int main(int argc, char** argv)
else if(filesystem::file_exists(exe_dir + "/../data/_main.cfg")) {
auto_dir = filesystem::normalize_path(exe_dir + "/..");
}
// In Windows debug builds, the EXE is placed away from the game data dir
// (in projectfiles\VCx\Debug), but the working directory is set to the
// game data dir. Thus, check if the working dir is the game data dir.
else if(filesystem::file_exists(filesystem::get_cwd() + "/data/_main.cfg")) {
auto_dir = filesystem::get_cwd();
}

if(!auto_dir.empty()) {
std::cerr << "Automatically found a possible data directory at "
Expand Down

0 comments on commit 6d82f98

Please sign in to comment.