feat(PlayerMethods): expose GetMItem (#5)

This commit is contained in:
Axel Cocat
2021-11-04 11:23:07 +01:00
committed by GitHub
parent 437ab62996
commit df8b3efbbe
2 changed files with 15 additions and 0 deletions

View File

@@ -467,6 +467,7 @@ ElunaRegister<Player> PlayerMethods[] =
{ "GetItemByPos", &LuaPlayer::GetItemByPos },
{ "GetItemByEntry", &LuaPlayer::GetItemByEntry },
{ "GetItemByGUID", &LuaPlayer::GetItemByGUID },
{ "GetMailItem", &LuaPlayer::GetMailItem },
{ "GetReputation", &LuaPlayer::GetReputation },
{ "GetEquippedItemBySlot", &LuaPlayer::GetEquippedItemBySlot },
{ "GetQuestLevel", &LuaPlayer::GetQuestLevel },

View File

@@ -1381,6 +1381,20 @@ namespace LuaPlayer
return 1;
}
/**
* Returns a mailed [Item] by guid.
*
* @param ObjectGuid guid : an item guid
* @return [Item] item
*/
int GetMailItem(lua_State* L, Player* player)
{
ObjectGuid guid = Eluna::CHECKVAL<ObjectGuid>(L, 2);
Eluna::Push(L, player->GetMItem(guid.GetCounter()));
return 1;
}
/**
* Returns an [Item] from the player by entry.
*