diff options
Diffstat (limited to 'src/script/lua_api')
-rw-r--r-- | src/script/lua_api/l_mapgen.cpp | 13 |
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; |