mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Make MetaDataRef:get return nil instead of nothing (#11666)
This commit is contained in:
parent
4fca601e0c
commit
5aa95fef10
1 changed files with 3 additions and 2 deletions
|
@ -82,9 +82,10 @@ int MetaDataRef::l_get(lua_State *L)
|
||||||
std::string str;
|
std::string str;
|
||||||
if (meta->getStringToRef(name, str)) {
|
if (meta->getStringToRef(name, str)) {
|
||||||
lua_pushlstring(L, str.c_str(), str.size());
|
lua_pushlstring(L, str.c_str(), str.size());
|
||||||
return 1;
|
} else {
|
||||||
|
lua_pushnil(L);
|
||||||
}
|
}
|
||||||
return 0;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// get_string(self, name)
|
// get_string(self, name)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue