Skip to content

Commit

Permalink
Update PlayerMethods.h
Browse files Browse the repository at this point in the history
  • Loading branch information
manstfu authored Feb 7, 2025
1 parent d869057 commit df1b97e
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/LuaEngine/methods/PlayerMethods.h
Original file line number Diff line number Diff line change
Expand Up @@ -2281,12 +2281,22 @@ namespace LuaPlayer
* Sends a trainer window to the [Player] from the [Creature] specified
*
* @param [Creature] sender
* @param uint32 entry : trainer entry
*/

int SendTrainerList(lua_State* L, Player* player)
{
Creature* obj = Eluna::CHECKOBJ<Creature>(L, 2);
uint32 entry = Eluna::CHECKVAL<uint32>(L, 3, 0);

if (!entry) {
Creature* obj = Eluna::CHECKOBJ<Creature>(L, 2);
player->GetSession()->SendTrainerList(obj->GET_GUID());
}
else {
WorldObject* obj = Eluna::CHECKOBJ<WorldObject>(L, 2);
player->GetSession()->SendTrainerList(obj->GET_GUID(), entry);
}

player->GetSession()->SendTrainerList(obj->GET_GUID());
return 0;
}

Expand Down

0 comments on commit df1b97e

Please sign in to comment.