Skip to content

Commit

Permalink
feat: add Player:GetTrader (#126)
Browse files Browse the repository at this point in the history
  • Loading branch information
r-o-b-o-t-o authored Apr 15, 2023
1 parent cea79af commit 2a683a5
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/LuaEngine/LuaFunctions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -544,6 +544,7 @@ ElunaRegister<Player> PlayerMethods[] =
{ "GetHonorLastWeekStandingPos", &LuaPlayer::GetHonorLastWeekStandingPos },
#endif
{ "GetPlayerSettingValue", &LuaPlayer::GetPlayerSettingValue },
{ "GetTrader", &LuaPlayer::GetTrader },

// Setters
{ "AdvanceSkillsToMax", &LuaPlayer::AdvanceSkillsToMax },
Expand Down
11 changes: 11 additions & 0 deletions src/LuaEngine/PlayerMethods.h
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 2a683a5

Please sign in to comment.