From a5bdfb6b3cfddaac1e961bd8c8780c74ccde3567 Mon Sep 17 00:00:00 2001 From: Duane Robertson Date: Tue, 29 Sep 2015 12:38:08 -0500 Subject: Add get_biome_id(biome_name) callback It returns the index used in mg->biomemap for a given biome name. The biomemap is useless without this unless you re-register all existing biomes, which could cause problems for anyone else trying to use biomemap. With this, you can quickly create a lookup table of ids and names. --- src/script/lua_api/l_mapgen.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/script/lua_api/l_mapgen.h') diff --git a/src/script/lua_api/l_mapgen.h b/src/script/lua_api/l_mapgen.h index 7440d1285..4768f934d 100644 --- a/src/script/lua_api/l_mapgen.h +++ b/src/script/lua_api/l_mapgen.h @@ -24,6 +24,10 @@ with this program; if not, write to the Free Software Foundation, Inc., class ModApiMapgen : public ModApiBase { private: + // get_biome_id(biomename) + // returns the biome id used in biomemap + static int l_get_biome_id(lua_State *L); + // get_mapgen_object(objectname) // returns the requested object used during map generation static int l_get_mapgen_object(lua_State *L); -- cgit v1.2.3