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:
parent
900fa26965
commit
61dfa912f5
4 changed files with 106 additions and 19 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue