feat: add Player:GetMailCount() (#76)
This commit is contained in:
@@ -1416,6 +1416,26 @@ namespace LuaPlayer
|
||||
return 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the amount of mails in the player's mailbox.
|
||||
*
|
||||
* @return uint32 mailCount
|
||||
*/
|
||||
int GetMailCount(lua_State* L, Player* player)
|
||||
{
|
||||
const CharacterCacheEntry* cache = sCharacterCache->GetCharacterCacheByGuid(player->GetGUID());
|
||||
if (cache)
|
||||
{
|
||||
Eluna::Push(L, static_cast<uint32>(cache->MailCount));
|
||||
}
|
||||
else
|
||||
{
|
||||
Eluna::Push(L, player->GetMailSize());
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a mailed [Item] by guid.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user