aboutsummaryrefslogtreecommitdiff
path: root/src/script
diff options
context:
space:
mode:
authorkwolekr <kwolekr@minetest.net>2015-01-04 03:21:42 -0500
committerkwolekr <kwolekr@minetest.net>2015-01-04 03:24:40 -0500
commit8eb9cebdd058c7df0c1735cd083f09d962c7bb84 (patch)
tree7d4dcbd11b4f4383a474d03e7c25c04bc92aad2c /src/script
parentef8ed5d127f2c698586efdfd254c8e5c7ba66f19 (diff)
downloadminetest-8eb9cebdd058c7df0c1735cd083f09d962c7bb84.tar.gz
minetest-8eb9cebdd058c7df0c1735cd083f09d962c7bb84.tar.bz2
minetest-8eb9cebdd058c7df0c1735cd083f09d962c7bb84.zip
Add warning about using deprecated fields in Mapgen API and update docs
Diffstat (limited to 'src/script')
-rw-r--r--src/script/lua_api/l_mapgen.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/script/lua_api/l_mapgen.cpp b/src/script/lua_api/l_mapgen.cpp
index d7c687bd8..7d9987e72 100644
--- a/src/script/lua_api/l_mapgen.cpp
+++ b/src/script/lua_api/l_mapgen.cpp
@@ -375,12 +375,11 @@ int ModApiMapgen::l_set_mapgen_params(lua_State *L)
if (lua_isnumber(L, -1))
params->water_level = lua_tointeger(L, -1);
+ warn_if_field_exists(L, 1, "flagmask",
+ "Deprecated: flags field now includes unset flags.");
lua_getfield(L, 1, "flagmask");
- if (lua_isstring(L, -1)) {
+ if (lua_isstring(L, -1))
params->flags &= ~readFlagString(lua_tostring(L, -1), flagdesc_mapgen, NULL);
- errorstream << "set_mapgen_params(): flagmask field is deprecated, "
- "see lua_api.txt" << std::endl;
- }
if (getflagsfield(L, 1, "flags", flagdesc_mapgen, &flags, &flagmask)) {
params->flags &= ~flagmask;
@@ -687,8 +686,11 @@ int ModApiMapgen::l_register_ore(lua_State *L)
ore->noise = NULL;
ore->flags = 0;
- // height_min and height_max are aliases for y_min and y_max, respectively,
- // for backwards compatibility
+ warn_if_field_exists(L, index, "height_min",
+ "Deprecated: new name is \"y_min\".");
+ warn_if_field_exists(L, index, "height_max",
+ "Deprecated: new name is \"y_max\".");
+
int ymin, ymax;
if (!getintfield(L, index, "y_min", ymin) &&
!getintfield(L, index, "height_min", ymin))