From 9860dacbb6526138ae8edf57adc42ddc3e6073fa Mon Sep 17 00:00:00 2001 From: Erik Schilling Date: Tue, 15 Jan 2013 10:24:22 +0100 Subject: 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 --- src/common/resourcemanager.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/common/resourcemanager.cpp b/src/common/resourcemanager.cpp index edff1e0a..45735b46 100644 --- a/src/common/resourcemanager.cpp +++ b/src/common/resourcemanager.cpp @@ -38,17 +38,21 @@ #include +#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); } /** -- cgit v1.2.3-70-g09d2