aboutsummaryrefslogtreecommitdiff
path: root/src/script/lua_api/l_metadata.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/script/lua_api/l_metadata.cpp')
-rw-r--r--src/script/lua_api/l_metadata.cpp2
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));