1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Ore: Add Vein ore type

This commit is contained in:
kwolekr 2014-12-28 21:17:12 -05:00
parent 900fa26965
commit 61dfa912f5
4 changed files with 106 additions and 19 deletions

View file

@ -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;