From 61dfa912f5f37f435e41b3c7d8cdb6244562e597 Mon Sep 17 00:00:00 2001 From: kwolekr Date: Sun, 28 Dec 2014 21:17:12 -0500 Subject: Ore: Add Vein ore type --- src/script/lua_api/l_mapgen.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'src/script/lua_api') diff --git a/src/script/lua_api/l_mapgen.cpp b/src/script/lua_api/l_mapgen.cpp index 8c81412b1..c0a58305b 100644 --- a/src/script/lua_api/l_mapgen.cpp +++ b/src/script/lua_api/l_mapgen.cpp @@ -68,9 +68,10 @@ struct EnumString ModApiMapgen::es_MapgenObject[] = struct EnumString ModApiMapgen::es_OreType[] = { - {ORE_TYPE_SCATTER, "scatter"}, - {ORE_TYPE_SHEET, "sheet"}, - {ORE_TYPE_BLOB, "blob"}, + {ORE_TYPE_SCATTER, "scatter"}, + {ORE_TYPE_SHEET, "sheet"}, + {ORE_TYPE_BLOB, "blob"}, + {ORE_TYPE_VEIN, "vein"}, {0, NULL}, }; @@ -680,6 +681,12 @@ int ModApiMapgen::l_register_ore(lua_State *L) } lua_pop(L, 1); + if (oretype == ORE_TYPE_VEIN) { + OreVein *orevein = (OreVein *)ore; + orevein->random_factor = getfloatfield_default(L, index, + "random_factor", 1.f); + } + u32 id = oremgr->add(ore); if (id == (u32)-1) { delete ore; -- cgit v1.2.3