mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-05-10 10:51:42 +00:00
Use the same names as userdataType() for userdataMetatable()
This commit is contained in:
parent
bbd09eace1
commit
a8c44ebb6a
1 changed files with 11 additions and 1 deletions
|
|
@ -278,8 +278,18 @@ static int lib_registerMetatable(lua_State *L)
|
||||||
// Returns nil if the string does not refer to a valid userdata type
|
// Returns nil if the string does not refer to a valid userdata type
|
||||||
static int lib_userdataMetatable(lua_State *L)
|
static int lib_userdataMetatable(lua_State *L)
|
||||||
{
|
{
|
||||||
|
UINT32 i;
|
||||||
const char *udname = luaL_checkstring(L, 1);
|
const char *udname = luaL_checkstring(L, 1);
|
||||||
luaL_getmetatable(L, udname);
|
|
||||||
|
// Find internal metatable name
|
||||||
|
for (i = 0; meta2utype[i].meta; i++)
|
||||||
|
if (!strcmp(udname, meta2utype[i].utype))
|
||||||
|
{
|
||||||
|
luaL_getmetatable(L, meta2utype[i].meta);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
lua_pushnil(L);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue