From a276654b0a89f0a5b76cb15180732cd8060e948d Mon Sep 17 00:00:00 2001 From: Mike Swanson Date: Fri, 13 Jun 2014 05:48:07 -0700 Subject: [PATCH] Fix finding game data on Linux by searching the share path first The logic here was in reverse, so just flip around the blocks. --- neo/sys/linux/main.cpp | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/neo/sys/linux/main.cpp b/neo/sys/linux/main.cpp index d4b52b08..9b77c361 100644 --- a/neo/sys/linux/main.cpp +++ b/neo/sys/linux/main.cpp @@ -62,6 +62,16 @@ bool Sys_GetPath(sysPath_t type, idStr &path) { common->Warning("base path '" BUILD_DATADIR "' does not exist"); + // fallback to vanilla doom3 install + if (stat(LINUX_DEFAULT_PATH, &st) != -1 && S_ISDIR(st.st_mode)) { + common->Warning("using hardcoded default base path"); + + path = LINUX_DEFAULT_PATH; + return true; + } + + common->Warning("base path '" LINUX_DEFAULT_PATH "' does not exist"); + // try next to the executable.. if (Sys_GetPath(PATH_EXE, path)) { path = path.StripFilename(); @@ -73,14 +83,6 @@ bool Sys_GetPath(sysPath_t type, idStr &path) { } } - // fallback to vanilla doom3 install - if (stat(LINUX_DEFAULT_PATH, &st) != -1 && S_ISDIR(st.st_mode)) { - common->Warning("using hardcoded default base path"); - - path = LINUX_DEFAULT_PATH; - return true; - } - return false; case PATH_CONFIG: