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

@@ -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();