From 6d82f98f658e8a46db6c3b7aa4f7f09ac9c32783 Mon Sep 17 00:00:00 2001 From: Jyrki Vesterinen Date: Tue, 19 Jan 2016 08:11:04 +0200 Subject: [PATCH] Try to find game data from the working directory too --- src/wesnoth.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/wesnoth.cpp b/src/wesnoth.cpp index d730206516bc..5e8ff25b6753 100644 --- a/src/wesnoth.cpp +++ b/src/wesnoth.cpp @@ -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 "