summaryrefslogtreecommitdiff
path: root/src/fileio.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2007-06-21 14:32:27 +0000
committerrubidium <rubidium@openttd.org>2007-06-21 14:32:27 +0000
commitf806b46cc967202db3d2fbf3384d0f037c13ed8a (patch)
tree4d9bfa9de886f7ff167c4fa02326f5cd302e8cce /src/fileio.cpp
parent06fded123a346d556ceb2f4585429046ddf8f1b9 (diff)
downloadopenttd-f806b46cc967202db3d2fbf3384d0f037c13ed8a.tar.xz
(svn r10246) -Fix (r10297): some forgotten money conversions and truncation issues. Thanks to benc for providing the patch.
Diffstat (limited to 'src/fileio.cpp')
-rw-r--r--src/fileio.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/fileio.cpp b/src/fileio.cpp
index b7c060fed..2b37dabf2 100644
--- a/src/fileio.cpp
+++ b/src/fileio.cpp
@@ -410,7 +410,9 @@ void ChangeWorkingDirectory(const char *exe)
void DetermineBasePaths(const char *exe)
{
char tmp[MAX_PATH];
-#ifdef WITH_PERSONAL_DIR
+#if defined(__MORPHOS__) || defined(__AMIGA__) || !defined(WITH_PERSONAL_DIR)
+ _searchpaths[SP_PERSONAL_DIR] = NULL;
+#else
const char *homedir = getenv("HOME");
if (homedir == NULL) {
@@ -422,14 +424,16 @@ void DetermineBasePaths(const char *exe)
AppendPathSeparator(tmp, MAX_PATH);
_searchpaths[SP_PERSONAL_DIR] = strdup(tmp);
-#else
- _searchpaths[SP_PERSONAL_DIR] = NULL;
#endif
_searchpaths[SP_SHARED_DIR] = NULL;
+#if defined(__MORPHOS__) || defined(__AMIGA__)
+ _searchpaths[SP_WORKING_DIR] = NULL;
+#else
getcwd(tmp, MAX_PATH);
AppendPathSeparator(tmp, MAX_PATH);
_searchpaths[SP_WORKING_DIR] = strdup(tmp);
+#endif
/* Change the working directory to that one of the executable */
ChangeWorkingDirectory((char*)exe);
@@ -437,9 +441,13 @@ void DetermineBasePaths(const char *exe)
AppendPathSeparator(tmp, MAX_PATH);
_searchpaths[SP_BINARY_DIR] = strdup(tmp);
+#if defined(__MORPHOS__) || defined(__AMIGA__)
+ _searchpaths[SP_INSTALLATION_DIR] = NULL;
+#else
snprintf(tmp, MAX_PATH, "%s", GLOBAL_DATA_DIR);
AppendPathSeparator(tmp, MAX_PATH);
_searchpaths[SP_INSTALLATION_DIR] = strdup(tmp);
+#endif
#ifdef WITH_COCOA
extern void cocoaSetApplicationBundleDir();
cocoaSetApplicationBundleDir();