diff options
author | Loïc Blot <nerzhul@users.noreply.github.com> | 2018-06-30 17:11:38 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-06-30 17:11:38 +0200 |
commit | eef62c82a2e58700fc1216b0b8c03e421bc77995 (patch) | |
tree | 4c49e659069036cb53d69535dc33d33f29d963f4 /src/script/lua_api/l_vmanip.cpp | |
parent | 227c71eb76e019873b30e2d3893b68307d51d58f (diff) | |
download | minetest-eef62c82a2e58700fc1216b0b8c03e421bc77995.tar.gz minetest-eef62c82a2e58700fc1216b0b8c03e421bc77995.tar.bz2 minetest-eef62c82a2e58700fc1216b0b8c03e421bc77995.zip |
Modernize lua read (part 2 & 3): C++ templating assurance (#7410)
* Modernize lua read (part 2 & 3): C++ templating assurance
Implement the boolean reader
Implement the string reader
Also remove unused & unimplemented script_error_handler
Add a reader with default value
Diffstat (limited to 'src/script/lua_api/l_vmanip.cpp')
-rw-r--r-- | src/script/lua_api/l_vmanip.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/script/lua_api/l_vmanip.cpp b/src/script/lua_api/l_vmanip.cpp index f6239339c..9eb246f1e 100644 --- a/src/script/lua_api/l_vmanip.cpp +++ b/src/script/lua_api/l_vmanip.cpp @@ -111,7 +111,7 @@ int LuaVoxelManip::l_write_to_map(lua_State *L) MAP_LOCK_REQUIRED; LuaVoxelManip *o = checkobject(L, 1); - bool update_light = !lua_isboolean(L, 2) || lua_toboolean(L, 2); + bool update_light = !lua_isboolean(L, 2) || readParam<bool>(L, 2); GET_ENV_PTR; ServerMap *map = &(env->getServerMap()); if (o->is_mapgen_vm || !update_light) { @@ -197,7 +197,7 @@ int LuaVoxelManip::l_calc_lighting(lua_State *L) v3s16 fpmax = vm->m_area.MaxEdge; v3s16 pmin = lua_istable(L, 2) ? check_v3s16(L, 2) : fpmin + yblock; v3s16 pmax = lua_istable(L, 3) ? check_v3s16(L, 3) : fpmax - yblock; - bool propagate_shadow = !lua_isboolean(L, 4) || lua_toboolean(L, 4); + bool propagate_shadow = !lua_isboolean(L, 4) || readParam<bool>(L, 4); sortBoxVerticies(pmin, pmax); if (!vm->m_area.contains(VoxelArea(pmin, pmax))) |