From 306d1ab866a3ce820e95f4faf805684cd4122ae4 Mon Sep 17 00:00:00 2001 From: Perttu Ahola Date: Thu, 21 Mar 2013 18:48:21 +0200 Subject: Common mods support Implement "common mods", includeable from {$user,$share}/games/common/$modname by using the game.conf setting common_mods = $modname,$modname2,... --- src/subgame.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'src/subgame.cpp') diff --git a/src/subgame.cpp b/src/subgame.cpp index 3c8bf53c5..8678ae37f 100644 --- a/src/subgame.cpp +++ b/src/subgame.cpp @@ -24,12 +24,16 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "log.h" #include "util/string.h" -std::string getGameName(const std::string &game_path) +bool getGameConfig(const std::string &game_path, Settings &conf) { std::string conf_path = game_path + DIR_DELIM + "game.conf"; + return conf.readConfigFile(conf_path.c_str()); +} + +std::string getGameName(const std::string &game_path) +{ Settings conf; - bool succeeded = conf.readConfigFile(conf_path.c_str()); - if(!succeeded) + if(!getGameConfig(game_path, conf)) return ""; if(!conf.exists("name")) return ""; @@ -117,6 +121,11 @@ std::set getAvailableGameIds() for(u32 j=0; j Date: Thu, 21 Mar 2013 21:42:23 +0200 Subject: Support game-specific minetest.conf --- src/subgame.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/subgame.cpp') diff --git a/src/subgame.cpp b/src/subgame.cpp index 8678ae37f..19ad4e636 100644 --- a/src/subgame.cpp +++ b/src/subgame.cpp @@ -24,6 +24,12 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "log.h" #include "util/string.h" +bool getGameMinetestConfig(const std::string &game_path, Settings &conf) +{ + std::string conf_path = game_path + DIR_DELIM + "minetest.conf"; + return conf.readConfigFile(conf_path.c_str()); +} + bool getGameConfig(const std::string &game_path, Settings &conf) { std::string conf_path = game_path + DIR_DELIM + "game.conf"; -- cgit v1.2.3