Skip to content

Commit

Permalink
Revert "Auto delete MetaData when = 0 (#8770)" (#10183)
Browse files Browse the repository at this point in the history
This reverts commit 808eb4c.
  • Loading branch information
appgurueu authored Jul 16, 2020
1 parent cfaef5b commit 82731d0
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/script/lua_api/l_metadata.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down Expand Up @@ -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))
Expand Down

0 comments on commit 82731d0

Please sign in to comment.