aboutsummaryrefslogtreecommitdiff
path: root/src/rollback.cpp
diff options
context:
space:
mode:
authorparamat <paramat@users.noreply.github.com>2017-06-22 03:48:22 +0100
committerparamat <mat.gregory@virginmedia.com>2017-06-24 01:48:20 +0100
commit9a77397fbfb95a0b45ed33831291259626968500 (patch)
tree4401f572d9814699a52634fc4460738e98e23b4b /src/rollback.cpp
parent08f57e1e387580b0487d1da5c195e5bf532c672b (diff)
downloadminetest-9a77397fbfb95a0b45ed33831291259626968500.tar.gz
minetest-9a77397fbfb95a0b45ed33831291259626968500.tar.bz2
minetest-9a77397fbfb95a0b45ed33831291259626968500.zip
Mgvalleys: Use existing 'lava_max_height' value in CavesRandomWalk
Now that lava depth in large caves is variable we can use the already present 'lava_max_height' value to set the lava depth in them.
Diffstat (limited to 'src/rollback.cpp')
0 files changed, 0 insertions, 0 deletions
ef='#n127'>127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208
/*
Minetest
Copyright (C) 2013 celeron55, Perttu Ahola <celeron55@gmail.com>

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/

#ifndef MODS_HEADER
#define MODS_HEADER

#include "irrlichttypes.h"
#include <list>
#include <set>
#include <vector>
#include <string>
#include <map>
#include <json/json.h>
#include "config.h"

#define MODNAME_ALLOWED_CHARS "abcdefghijklmnopqrstuvwxyz0123456789_"

struct ModSpec
{
	std::string name;
	std::string path;
	//if normal mod:
	std::set<std::string> depends;
	std::set<std::string> optdepends;
	std::set<std::string> unsatisfied_depends;

	bool part_of_modpack;
	bool is_modpack;
	// if modpack:
	std::map<std::string,ModSpec> modpack_content;
	ModSpec(const std::string &name_="", const std::string &path_=""):
		name(name_),
		path(path_),
		depends(),
		optdepends(),
		unsatisfied_depends(),
		part_of_modpack(false),
		is_modpack(false),
		modpack_content()
	{}
};

// Retrieves depends, optdepends, is_modpack and modpack_content
void parseModContents(ModSpec &mod);

std::map<std::string,ModSpec> getModsInPath(std::string path, bool part_of_modpack = false);

// If failed, returned modspec has name==""
ModSpec findCommonMod(const std::string &modname);

// expands modpack contents, but does not replace them.
std::map<std::string, ModSpec> flattenModTree(std::map<std::string, ModSpec> mods);

// replaces modpack Modspecs with their content
std::vector<ModSpec> flattenMods(std::map<std::string,ModSpec> mods);