]> git.lizzy.rs Git - minetest.git/commitdiff
Add warning about using deprecated fields in Mapgen API and update docs
authorkwolekr <kwolekr@minetest.net>
Sun, 4 Jan 2015 08:21:42 +0000 (03:21 -0500)
committerkwolekr <kwolekr@minetest.net>
Sun, 4 Jan 2015 08:24:40 +0000 (03:24 -0500)
doc/lua_api.txt
src/script/lua_api/l_mapgen.cpp

index 07d756aa497a0ad6bdc116c85a7cca360135d746..52a6752fd1df93bdf4b0e9f7d22058d2db242c3c 100644 (file)
@@ -710,7 +710,7 @@ See section "Flag Specifier Format".
 Currently supported flags: `absheight`
 
 ### `absheight`
-Also produce this same ore between the height range of `-height_max` and `-height_min`.
+Also produce this same ore between the height range of `-y_max` and `-y_min`.
 
 Useful for having ore in sky realms without having to duplicate ore entries.
 
@@ -3032,8 +3032,8 @@ Definition tables
         clust_size = 3,
     --  ^ Size of the bounding box of the cluster
     --  ^ In this example, there is a 3x3x3 cluster where 8 out of the 27 nodes are coal ore
-        height_min = -31000,
-        height_max = 64,
+        y_min = -31000,
+        y_max = 64,
         flags = "",
     --  ^ Attributes for this ore generation
         noise_threshhold = 0.5,
@@ -3065,8 +3065,8 @@ Definition tables
         biomes = {"Oceanside", "Hills", "Plains"},
     --  ^ List of biomes in which this decoration occurs.  Occurs in all biomes if this is omitted,
     --  ^ and ignored if the Mapgen being used does not support biomes.
-        height_min = -31000
-        height_max = 31000
+        y_min = -31000
+        y_max = 31000
     -- ^ Minimum and maximum `y` positions these decorations can be generated at.
     -- ^ This parameter refers to the `y` position of the decoration base, so
     --   the actual maximum height would be `height_max + size.Y`.
index d7c687bd842fc3136896518e79b6ba8983e40c65..7d9987e728ddb8f6e8e186738aadf3097b18f35c 100644 (file)
@@ -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))