summaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
authorJared Adams <jaxad0127@gmail.com>2009-02-15 13:14:42 +0000
committerJared Adams <jaxad0127@gmail.com>2009-02-15 13:14:42 +0000
commit2398fc21de78bb720de672355c7972999a92e47a (patch)
treec23dce811edf25dcd93dc753a0ba659dd15cb2dd /src/main.cpp
parent79e803232438d41cce80467a97e9efde8e6c0c70 (diff)
downloadmana-2398fc21de78bb720de672355c7972999a92e47a.tar.gz
mana-2398fc21de78bb720de672355c7972999a92e47a.tar.bz2
mana-2398fc21de78bb720de672355c7972999a92e47a.tar.xz
mana-2398fc21de78bb720de672355c7972999a92e47a.zip
Fix setting of home directory for OSX
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/main.cpp b/src/main.cpp
index a368ae5c..85ea4b1f 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -261,14 +261,18 @@ void setUpdatesDir()
void init_engine(const Options &options)
{
if (homeDir.empty())
+#if defined __APPLE__
+ // Use Application Directory instead of .tmw
+ homeDir = std::string(PHYSFS_getUserDir()) +
+ "/Library/Application Support/The Mana World";
+#else
homeDir = std::string(PHYSFS_getUserDir()) + "/.tmw";
+#endif
+
#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