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_metadata.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_metadata.cpp')
-rw-r--r-- | src/script/lua_api/l_metadata.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/script/lua_api/l_metadata.cpp b/src/script/lua_api/l_metadata.cpp index 59017dbff..4f64cc8a6 100644 --- a/src/script/lua_api/l_metadata.cpp +++ b/src/script/lua_api/l_metadata.cpp @@ -275,7 +275,7 @@ bool MetaDataRef::handleFromTable(lua_State *L, int table, Metadata *meta) lua_pushnil(L); while (lua_next(L, fieldstable) != 0) { // key at index -2 and value at index -1 - std::string name = lua_tostring(L, -2); + std::string name = readParam<std::string>(L, -2); size_t cl; const char *cs = lua_tolstring(L, -1, &cl); meta->setString(name, std::string(cs, cl)); |