mirror of
https://github.com/azerothcore/mod-ale
synced 2025-11-29 15:38:17 +08:00
feat: expose IsPlayer()
expose IsPlayer()
This commit is contained in:
@@ -180,6 +180,7 @@ ElunaRegister<Object> ObjectMethods[] =
|
||||
|
||||
// Boolean
|
||||
{ "IsInWorld", &LuaObject::IsInWorld },
|
||||
{ "IsPlayer", &LuaObject::IsPlayer },
|
||||
{ "HasFlag", &LuaObject::HasFlag },
|
||||
|
||||
// Other
|
||||
|
||||
@@ -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.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user