aboutsummaryrefslogtreecommitdiff
path: root/src/script/lua_api
diff options
context:
space:
mode:
Diffstat (limited to 'src/script/lua_api')
-rw-r--r--src/script/lua_api/l_mapgen.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/script/lua_api/l_mapgen.cpp b/src/script/lua_api/l_mapgen.cpp
index da8e71cdc..cefea3da9 100644
--- a/src/script/lua_api/l_mapgen.cpp
+++ b/src/script/lua_api/l_mapgen.cpp
@@ -975,6 +975,7 @@ bool read_deco_simple(lua_State *L, DecoSimple *deco)
deco->deco_height = getintfield_default(L, index, "height", 1);
deco->deco_height_max = getintfield_default(L, index, "height_max", 0);
+ deco->deco_param2 = getintfield_default(L, index, "param2", 0);
if (deco->deco_height <= 0) {
errorstream << "register_decoration: simple decoration height"
@@ -990,6 +991,12 @@ bool read_deco_simple(lua_State *L, DecoSimple *deco)
return false;
}
+ if ((deco->deco_param2 < 0) || (deco->deco_param2 > 255)) {
+ errorstream << "register_decoration: param2 out of bounds (0-255)"
+ << std::endl;
+ return false;
+ }
+
return true;
}