]> git.lizzy.rs Git - dragonfireclient.git/commitdiff
Make MetaDataRef:get return nil instead of nothing (#11666)
authorJude Melton-Houghton <jwmhjwmh@gmail.com>
Tue, 5 Oct 2021 12:38:33 +0000 (08:38 -0400)
committerGitHub <noreply@github.com>
Tue, 5 Oct 2021 12:38:33 +0000 (15:38 +0300)
src/script/lua_api/l_metadata.cpp

index 21002e6a70734bb0c674cde9596e79263da5f9bd..d00cb4daa7c4d53348c4abe0f22f3361d2254df0 100644 (file)
@@ -82,9 +82,10 @@ int MetaDataRef::l_get(lua_State *L)
        std::string str;
        if (meta->getStringToRef(name, str)) {
                lua_pushlstring(L, str.c_str(), str.size());
-               return 1;
+       } else {
+               lua_pushnil(L);
        }
-       return 0;
+       return 1;
 }
 
 // get_string(self, name)