1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-08-06 17:41:04 +00:00

Minor script api fixes/cleanups

This commit is contained in:
sfan5 2022-12-28 23:37:31 +01:00
parent 5b6bc8a12b
commit 524d446757
11 changed files with 37 additions and 36 deletions

View file

@ -59,8 +59,7 @@ bool ScriptApiEntity::luaentity_Add(u16 id, const char *name)
// This should be userdata with metatable ObjectRef
push_objectRef(L, id);
luaL_checktype(L, -1, LUA_TUSERDATA);
if (!luaL_checkudata(L, -1, "ObjectRef"))
luaL_typerror(L, -1, "ObjectRef");
luaL_checkudata(L, -1, "ObjectRef");
lua_setfield(L, -2, "object");
// core.luaentities[id] = object