aboutsummaryrefslogtreecommitdiff
path: root/src/script/lua_api
diff options
context:
space:
mode:
authorkwolekr <kwolekr@minetest.net>2014-12-28 21:17:12 -0500
committerkwolekr <kwolekr@minetest.net>2014-12-28 21:17:12 -0500
commit61dfa912f5f37f435e41b3c7d8cdb6244562e597 (patch)
treeb3cde6151a714d3cee7d0646aac1936f89410eb3 /src/script/lua_api
parent900fa26965a2fbdf2b9de74e2d680c083de91482 (diff)
downloadminetest-61dfa912f5f37f435e41b3c7d8cdb6244562e597.tar.gz
minetest-61dfa912f5f37f435e41b3c7d8cdb6244562e597.tar.bz2
minetest-61dfa912f5f37f435e41b3c7d8cdb6244562e597.zip
Ore: Add Vein ore type
Diffstat (limited to 'src/script/lua_api')
-rw-r--r--src/script/lua_api/l_mapgen.cpp13
1 files changed, 10 insertions, 3 deletions
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;