diff options
author | Lars Müller <34514239+appgurueu@users.noreply.github.com> | 2020-07-16 19:11:24 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-16 19:11:24 +0200 |
commit | 82731d0d3d8bfe9e56f89466991f13c037f3a61e (patch) | |
tree | 46cc873577c74297bba73216d39e21e3d55500bf /src/script/lua_api | |
parent | cfaef5b1cfc8ec7463a2e8aec420bfc3a434f9c1 (diff) | |
download | minetest-82731d0d3d8bfe9e56f89466991f13c037f3a61e.tar.gz minetest-82731d0d3d8bfe9e56f89466991f13c037f3a61e.tar.bz2 minetest-82731d0d3d8bfe9e56f89466991f13c037f3a61e.zip |
Revert "Auto delete MetaData when = 0 (#8770)" (#10183)
This reverts commit 808eb4c5714da5ac36f4a70653d6b3805060828c.
Diffstat (limited to 'src/script/lua_api')
-rw-r--r-- | src/script/lua_api/l_metadata.cpp | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/script/lua_api/l_metadata.cpp b/src/script/lua_api/l_metadata.cpp index 61a25a761..21002e6a7 100644 --- a/src/script/lua_api/l_metadata.cpp +++ b/src/script/lua_api/l_metadata.cpp @@ -153,9 +153,7 @@ int MetaDataRef::l_set_int(lua_State *L) MetaDataRef *ref = checkobject(L, 1); std::string name = luaL_checkstring(L, 2); int a = luaL_checkint(L, 3); - std::string str; - if (a != 0) - str = itos(a); + std::string str = itos(a); Metadata *meta = ref->getmeta(true); if (meta == NULL || str == meta->getString(name)) @@ -193,9 +191,7 @@ int MetaDataRef::l_set_float(lua_State *L) MetaDataRef *ref = checkobject(L, 1); std::string name = luaL_checkstring(L, 2); float a = readParam<float>(L, 3); - std::string str; - if (a != 0) - str = ftos(a); + std::string str = ftos(a); Metadata *meta = ref->getmeta(true); if (meta == NULL || str == meta->getString(name)) |