summaryrefslogtreecommitdiffstats
path: root/src/common
diff options
context:
space:
mode:
authorErik Schilling <ablu.erikschilling@googlemail.com>2013-01-15 10:24:22 +0100
committerErik Schilling <ablu.erikschilling@googlemail.com>2013-02-24 20:38:57 +0100
commit9860dacbb6526138ae8edf57adc42ddc3e6073fa (patch)
tree342c63b7cf515644be7e1a005813c75c0bc1bca6 /src/common
parent30a62acef45fb1652d0992dcbf30e473cea6bf74 (diff)
downloadmanaserv-9860dacbb6526138ae8edf57adc42ddc3e6073fa.tar.gz
manaserv-9860dacbb6526138ae8edf57adc42ddc3e6073fa.tar.xz
manaserv-9860dacbb6526138ae8edf57adc42ddc3e6073fa.zip
Made the scripts being able to install
The game server will now look for the scripts in this order: - serverPath - config value - current working directory - the PKG_DATADIR #define
Diffstat (limited to 'src/common')
-rw-r--r--src/common/resourcemanager.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/common/resourcemanager.cpp b/src/common/resourcemanager.cpp
index edff1e0..45735b4 100644
--- a/src/common/resourcemanager.cpp
+++ b/src/common/resourcemanager.cpp
@@ -38,17 +38,21 @@
#include <physfs.h>
+#ifndef PKG_DATADIR
+#define PKG_DATADIR "."
+#endif
+
void ResourceManager::initialize()
{
PHYSFS_permitSymbolicLinks(1);
- const std::string serverPath =
- Configuration::getValue("serverPath", ".");
const std::string worldDataPath =
Configuration::getValue("worldDataPath", "example");
- PHYSFS_addToSearchPath(serverPath.c_str(), 1);
+ // world first to allow overriding of server's libraries
PHYSFS_addToSearchPath(worldDataPath.c_str(), 1);
+ PHYSFS_addToSearchPath(".", 1);
+ PHYSFS_addToSearchPath(PKG_DATADIR, 1);
}
/**