1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-08-11 17:51:04 +00:00

Noise: Create a deep copy of NoiseParams

This commit is contained in:
kwolekr 2014-12-10 00:37:09 -05:00
parent 88c28414f4
commit fb2bc956b1
9 changed files with 91 additions and 91 deletions

View file

@ -546,7 +546,14 @@ int ModApiMapgen::l_register_ore(lua_State *L)
getflagsfield(L, index, "flags", flagdesc_ore, &ore->flags, NULL);
lua_getfield(L, index, "noise_params");
ore->np = get_noiseparams(L, -1);
if (read_noiseparams(L, -1, &ore->np)) {
ore->flags |= OREFLAG_USE_NOISE;
} else if (ore->NEEDS_NOISE) {
errorstream << "register_ore: specified ore type requires valid "
"noise parameters" << std::endl;
delete ore;
return 0;
}
lua_pop(L, 1);
u32 id = oremgr->add(ore);