aboutsummaryrefslogtreecommitdiff
path: root/src/script/lua_api
diff options
context:
space:
mode:
authorkwolekr <kwolekr@minetest.net>2013-08-04 22:59:22 -0400
committerkwolekr <kwolekr@minetest.net>2013-08-11 15:34:49 -0400
commitc06caa14c31ffa480146a7dbb7094224a486c1bd (patch)
treeaa647a832e856a9b71e5fed67a74cee52f405f6e /src/script/lua_api
parent56b9377c1c55a08eb5ae09c058f9f1cb8e9e4a73 (diff)
downloadminetest-c06caa14c31ffa480146a7dbb7094224a486c1bd.tar.gz
minetest-c06caa14c31ffa480146a7dbb7094224a486c1bd.tar.bz2
minetest-c06caa14c31ffa480146a7dbb7094224a486c1bd.zip
Decoration: Fix schematic probability mess with new MTS file version
Diffstat (limited to 'src/script/lua_api')
-rw-r--r--src/script/lua_api/luaapi.cpp11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/script/lua_api/luaapi.cpp b/src/script/lua_api/luaapi.cpp
index 929aa40d0..26fb0c318 100644
--- a/src/script/lua_api/luaapi.cpp
+++ b/src/script/lua_api/luaapi.cpp
@@ -867,7 +867,7 @@ int ModApiBasic::l_create_schematic(lua_State *L)
v3s16 p2 = read_v3s16(L, 2);
sortBoxVerticies(p1, p2);
- std::vector<std::pair<v3s16, s16> > probability_list;
+ std::vector<std::pair<v3s16, u8> > probability_list;
if (lua_istable(L, 3)) {
lua_pushnil(L);
while (lua_next(L, 3)) {
@@ -876,13 +876,8 @@ int ModApiBasic::l_create_schematic(lua_State *L)
v3s16 pos = read_v3s16(L, -1);
lua_pop(L, 1);
- s16 prob = getintfield_default(L, -1, "prob", 0);
- if (prob < -1 || prob >= UCHAR_MAX) {
- errorstream << "create_schematic: probability value of "
- << prob << " at " << PP(pos) << " out of range" << std::endl;
- } else {
- probability_list.push_back(std::make_pair(pos, prob));
- }
+ u8 prob = getintfield_default(L, -1, "prob", 0xFF);
+ probability_list.push_back(std::make_pair(pos, prob));
}
lua_pop(L, 1);