feat: expose IsPlayer()

expose IsPlayer()
This commit is contained in:
55Honey
2022-06-07 15:22:33 +02:00
committed by GitHub
2 changed files with 20 additions and 6 deletions

View File

@@ -180,6 +180,7 @@ ElunaRegister<Object> ObjectMethods[] =
// Boolean
{ "IsInWorld", &LuaObject::IsInWorld },
{ "IsPlayer", &LuaObject::IsPlayer },
{ "HasFlag", &LuaObject::HasFlag },
// Other

View File

@@ -51,6 +51,19 @@ namespace LuaObject
return 1;
}
/**
* Returns 'true' if the [Object] is a player, 'false' otherwise.
*
* @return bool IsPlayer
*/
int IsPlayer(lua_State* L, Object* obj)
{
#ifdef AZEROTHCORE //AC-only
Eluna::Push(L, obj->IsPlayer());
#endif
return 1;
}
/**
* Returns the data at the specified index, casted to a signed 32-bit integer.
*