mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-04-26 20:11:47 +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"
|
// or players[0].powers -> "player_t.powers"
|
||||||
static int lib_userdataType(lua_State *L)
|
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)
|
lua_settop(L, 1); // pop everything except arg 1 (in case somebody decided to add more)
|
||||||
luaL_checktype(L, 1, LUA_TUSERDATA);
|
type = lua_type(L, 1);
|
||||||
lua_pushstring(L, GetUserdataUType(L));
|
if (type == LUA_TLIGHTUSERDATA || type == LUA_TUSERDATA)
|
||||||
return 1;
|
{
|
||||||
|
lua_pushstring(L, GetUserdataUType(L));
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
return luaL_typerror(L, 1, "userdata");
|
||||||
}
|
}
|
||||||
|
|
||||||
static int lib_isPlayerAdmin(lua_State *L)
|
static int lib_isPlayerAdmin(lua_State *L)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue