feat: add Player:GetTrader (#126)

This commit is contained in:
Axel Cocat
2023-04-15 19:33:05 +02:00
committed by GitHub
parent cea79af0b1
commit 2a683a59e3
3 changed files with 13 additions and 0 deletions

View File

@@ -96,6 +96,7 @@ Eluna API for AC:
- Added `Player:GetAchievementCriteriaProgress()`: https://github.com/azerothcore/mod-eluna/pull/78
- Added vendor entry as argument to `Player:SendListInventory(object, vendorentry)`: https://github.com/azerothcore/mod-eluna/pull/48
- Added `Player:GetPlayerSettingValue()` and `Player:UpdatePlayerSetting()`: https://github.com/azerothcore/mod-eluna/pull/125
- Added `Player:GetTrader()`: https://github.com/azerothcore/mod-eluna/pull/126
### Group
- Added `Group:GetGroupType()`: https://github.com/azerothcore/mod-eluna/pull/82

View File

@@ -544,6 +544,7 @@ ElunaRegister<Player> PlayerMethods[] =
{ "GetHonorLastWeekStandingPos", &LuaPlayer::GetHonorLastWeekStandingPos },
#endif
{ "GetPlayerSettingValue", &LuaPlayer::GetPlayerSettingValue },
{ "GetTrader", &LuaPlayer::GetTrader },
// Setters
{ "AdvanceSkillsToMax", &LuaPlayer::AdvanceSkillsToMax },

View File

@@ -4199,6 +4199,17 @@ namespace LuaPlayer
return 1;
}
/**
* Returns the [Player] that is currently trading with this [Player]
*
* @return [Player] trader : the player trading, or nil
*/
int GetTrader(lua_State* L, Player* player)
{
Eluna::Push(L, player->GetTrader());
return 1;
}
/*int BindToInstance(lua_State* L, Player* player)
{
player->BindToInstance();