diff options
author | David Athay <ko2fan@gmail.com> | 2008-05-27 15:53:21 +0000 |
---|---|---|
committer | David Athay <ko2fan@gmail.com> | 2008-05-27 15:53:21 +0000 |
commit | c72778820c971184eef932cfea5654c66111f923 (patch) | |
tree | 05b60c64cf8f62d856980a810e365f801f761f00 | |
parent | 0367de5a7e6dad668bdb9de448dfc8b1f76ba1b2 (diff) | |
download | mana-c72778820c971184eef932cfea5654c66111f923.tar.gz mana-c72778820c971184eef932cfea5654c66111f923.tar.bz2 mana-c72778820c971184eef932cfea5654c66111f923.tar.xz mana-c72778820c971184eef932cfea5654c66111f923.zip |
Changed location of tmw directory on OSX
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | src/main.cpp | 6 | ||||
-rw-r--r-- | src/player_relations.cpp | 4 |
3 files changed, 13 insertions, 2 deletions
@@ -1,3 +1,8 @@ +2008-05-27 David Athay <ko2fan@gmail.com> + + * src/main.cpp, src/player_relations.cpp: Changed OSX tmw directory to a + more suitable location, and fixed compile error. + 2008-05-22 Bjørn Lindeijer <bjorn@lindeijer.nl> * src/Makefile.am, src/CMakeLists.txt: Fixed linker error caused by diff --git a/src/main.cpp b/src/main.cpp index db9f85ac..1c4895fa 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -145,6 +145,12 @@ void init_engine(const Options &options) #if defined WIN32 if (!CreateDirectory(homeDir.c_str(), 0) && GetLastError() != ERROR_ALREADY_EXISTS) +#elif defined __APPLE__ + // Use Application Directory instead of .tmw + homeDir = std::string(PHYSFS_getUserDir()) + + "/Library/Application Support/The Mana World"; + if ((mkdir(homeDir.c_str(), S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH) != 0) && + (errno != EEXIST)) #else // Checking if /home/user/.tmw folder exists. if ((mkdir(homeDir.c_str(), S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH) != 0) && diff --git a/src/player_relations.cpp b/src/player_relations.cpp index fe71191c..86e0861e 100644 --- a/src/player_relations.cpp +++ b/src/player_relations.cpp @@ -60,7 +60,7 @@ class PlayerConfSerialiser : public ConfigurationListManager<std::pair<std::stri return container; if (!(*container)[name]) { - int v = cobj->getValue(RELATION, PlayerRelation::NEUTRAL); + int v = (int)cobj->getValue(RELATION, PlayerRelation::NEUTRAL); (*container)[name] = new PlayerRelation(static_cast<PlayerRelation::relation>(v)); } // otherwise ignore the duplicate entry @@ -121,7 +121,7 @@ PlayerRelationsManager::load(void) clear(); mPersistIgnores = config.getValue(PERSIST_IGNORE_LIST, 0); - mDefaultPermissions = config.getValue(DEFAULT_PERMISSIONS, mDefaultPermissions); + mDefaultPermissions = (int)config.getValue(DEFAULT_PERMISSIONS, mDefaultPermissions); std::string ignore_strategy_name = config.getValue(PLAYER_IGNORE_STRATEGY, DEFAULT_IGNORE_STRATEGY); int ignore_strategy_index = getPlayerIgnoreStrategyIndex(ignore_strategy_name); if (ignore_strategy_index >= 0) |