From 85319b30fc78f8d8fa5500cb61dc96474116bcba Mon Sep 17 00:00:00 2001 From: SoftCoder Date: Fri, 3 Jan 2014 08:01:33 -0800 Subject: [PATCH] - fixup use of --data-path param --- source/glest_game/main/main.cpp | 3 +++ source/shared_lib/include/util/properties.h | 4 ++++ source/shared_lib/sources/util/properties.cpp | 13 +++++++------ 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/source/glest_game/main/main.cpp b/source/glest_game/main/main.cpp index 474a4482..4f6d6952 100644 --- a/source/glest_game/main/main.cpp +++ b/source/glest_game/main/main.cpp @@ -1337,6 +1337,8 @@ int setupGameItemPaths(int argc, char** argv, Config *config) { } } + Properties::setApplicationDataPath(pathCache[GameConstants::path_data_CacheLookupKey]); + //GAME_ARG_INI_PATH if(hasCommandArgument(argc, argv,GAME_ARGS[GAME_ARG_INI_PATH]) == true) { int foundParamIndIndex = -1; @@ -3977,6 +3979,7 @@ int glestMain(int argc, char** argv) { preCacheThread=NULL; Properties::setApplicationPath(executable_path(argv[0])); + Properties::setApplicationDataPath(executable_path(argv[0])); Properties::setGameVersion(glestVersionString); ServerSocket::setMaxPlayerCount(GameConstants::maxPlayers); diff --git a/source/shared_lib/include/util/properties.h b/source/shared_lib/include/util/properties.h index 51d5358b..977acae6 100644 --- a/source/shared_lib/include/util/properties.h +++ b/source/shared_lib/include/util/properties.h @@ -47,6 +47,7 @@ private: string path; static string applicationPath; + static string applicationDataPath; static string gameVersion; static string techtreePath; @@ -57,6 +58,9 @@ public: static void setApplicationPath(string value) { applicationPath=value; } static string getApplicationPath() { return applicationPath; } + static void setApplicationDataPath(string value) { applicationDataPath=value; } + static string getApplicationDataPath() { return applicationDataPath; } + static void setGameVersion(string value) { gameVersion=value; } static string getGameVersion() { return gameVersion; } diff --git a/source/shared_lib/sources/util/properties.cpp b/source/shared_lib/sources/util/properties.cpp index 6c5fc99f..11c62875 100644 --- a/source/shared_lib/sources/util/properties.cpp +++ b/source/shared_lib/sources/util/properties.cpp @@ -42,6 +42,7 @@ using namespace Shared::Graphics; namespace Shared{ namespace Util{ string Properties::applicationPath = ""; +string Properties::applicationDataPath = ""; string Properties::gameVersion = ""; string Properties::techtreePath = ""; @@ -234,9 +235,9 @@ std::map Properties::getTagReplacementValues(std::map * replaceAll(value, "{APPLICATIONDATAPATH}", formatPath(TOSTRING(CUSTOM_DATA_INSTALL_PATH))); #else - replaceAll(value, "$APPLICATIONDATAPATH", Properties::applicationPath); - replaceAll(value, "%%APPLICATIONDATAPATH%%", Properties::applicationPath); - replaceAll(value, "{APPLICATIONDATAPATH}", Properties::applicationPath); + replaceAll(value, "$APPLICATIONDATAPATH", Properties::applicationDataPath); + replaceAll(value, "%%APPLICATIONDATAPATH%%", Properties::applicationDataPath); + replaceAll(value, "{APPLICATIONDATAPATH}", Properties::applicationDataPath); #endif