diff options
author | kwolekr <kwolekr@minetest.net> | 2014-12-28 22:37:27 -0500 |
---|---|---|
committer | kwolekr <kwolekr@minetest.net> | 2014-12-28 22:37:27 -0500 |
commit | 863379a4c68b9862ea6913c1b1e475d022aba100 (patch) | |
tree | 00c6089cdf46a1bfaae17bc0c52ed90db47976d2 /src/script/lua_api/l_mapgen.cpp | |
parent | c5faa644056c892ccf5e41cfde87a5b107149951 (diff) | |
download | minetest-863379a4c68b9862ea6913c1b1e475d022aba100.tar.gz minetest-863379a4c68b9862ea6913c1b1e475d022aba100.tar.bz2 minetest-863379a4c68b9862ea6913c1b1e475d022aba100.zip |
Decoration: Add height_min and height_max parameters
Also set default height_min/height_max to -31000 and 31000,
respectively, for ore and biomes
Diffstat (limited to 'src/script/lua_api/l_mapgen.cpp')
-rw-r--r-- | src/script/lua_api/l_mapgen.cpp | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/src/script/lua_api/l_mapgen.cpp b/src/script/lua_api/l_mapgen.cpp index a2e5d31d1..cccbba5a8 100644 --- a/src/script/lua_api/l_mapgen.cpp +++ b/src/script/lua_api/l_mapgen.cpp @@ -423,14 +423,14 @@ int ModApiMapgen::l_register_biome(lua_State *L) Biome *b = bmgr->create(biometype); b->name = getstringfield_default(L, index, "name", ""); - b->depth_top = getintfield_default(L, index, "depth_top", 1); - b->depth_filler = getintfield_default(L, index, "depth_filler", 3); - b->height_shore = getintfield_default(L, index, "height_shore", 3); - b->depth_water_top = getintfield_default(L, index, "depth_water_top", 0); - b->height_min = getintfield_default(L, index, "height_min", 0); - b->height_max = getintfield_default(L, index, "height_max", 0); - b->heat_point = getfloatfield_default(L, index, "heat_point", 0.); - b->humidity_point = getfloatfield_default(L, index, "humidity_point", 0.); + b->depth_top = getintfield_default(L, index, "depth_top", 1); + b->depth_filler = getintfield_default(L, index, "depth_filler", 3); + b->height_shore = getintfield_default(L, index, "height_shore", 3); + b->depth_water_top = getintfield_default(L, index, "depth_water_top", 0); + b->height_min = getintfield_default(L, index, "height_min", -31000); + b->height_max = getintfield_default(L, index, "height_max", 31000); + b->heat_point = getfloatfield_default(L, index, "heat_point", 0.f); + b->humidity_point = getfloatfield_default(L, index, "humidity_point", 0.f); b->flags = 0; //reserved u32 id = bmgr->add(b); @@ -501,6 +501,8 @@ int ModApiMapgen::l_register_decoration(lua_State *L) deco->name = getstringfield_default(L, index, "name", ""); deco->fill_ratio = getfloatfield_default(L, index, "fill_ratio", 0.02); + deco->height_min = getintfield_default(L, index, "height_min", 31000); + deco->height_max = getintfield_default(L, index, "height_max", -31000); deco->sidelen = getintfield_default(L, index, "sidelen", 8); if (deco->sidelen <= 0) { errorstream << "register_decoration: sidelen must be " @@ -660,8 +662,8 @@ int ModApiMapgen::l_register_ore(lua_State *L) ore->clust_scarcity = getintfield_default(L, index, "clust_scarcity", 1); ore->clust_num_ores = getintfield_default(L, index, "clust_num_ores", 1); ore->clust_size = getintfield_default(L, index, "clust_size", 0); - ore->height_min = getintfield_default(L, index, "height_min", 0); - ore->height_max = getintfield_default(L, index, "height_max", 0); + ore->height_min = getintfield_default(L, index, "height_min", -31000); + ore->height_max = getintfield_default(L, index, "height_max", 31000); ore->nthresh = getfloatfield_default(L, index, "noise_threshhold", 0); ore->noise = NULL; ore->flags = 0; |