mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-03-09 20:56:43 +00:00
userdataType can check light userdata too!
This commit is contained in:
parent
4f41da1d16
commit
b77d597965
1 changed files with 9 additions and 3 deletions
|
|
@ -220,10 +220,16 @@ static const char *GetUserdataUType(lua_State *L)
|
|||
// or players[0].powers -> "player_t.powers"
|
||||
static int lib_userdataType(lua_State *L)
|
||||
{
|
||||
int type;
|
||||
lua_settop(L, 1); // pop everything except arg 1 (in case somebody decided to add more)
|
||||
luaL_checktype(L, 1, LUA_TUSERDATA);
|
||||
lua_pushstring(L, GetUserdataUType(L));
|
||||
return 1;
|
||||
type = lua_type(L, 1);
|
||||
if (type == LUA_TLIGHTUSERDATA || type == LUA_TUSERDATA)
|
||||
{
|
||||
lua_pushstring(L, GetUserdataUType(L));
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
return luaL_typerror(L, 1, "userdata");
|
||||
}
|
||||
|
||||
static int lib_isPlayerAdmin(lua_State *L)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue