feat: add PLAYER_EVENT_ON_CAN_JOIN_LFG (#86)

This commit is contained in:
Axel Cocat
2023-01-01 19:47:16 +01:00
committed by GitHub
parent 3700b4246a
commit 295fcefd01
6 changed files with 33 additions and 0 deletions

View File

@@ -613,3 +613,25 @@ bool Eluna::OnCanSendMail(Player* player, ObjectGuid receiverGuid, ObjectGuid ma
Push(item);
return CallAllFunctionsBool(PlayerEventBindings, key);
}
bool Eluna::OnCanJoinLfg(Player* player, uint8 roles, lfg::LfgDungeonSet& dungeons, const std::string& comment)
{
START_HOOK_WITH_RETVAL(PLAYER_EVENT_ON_CAN_JOIN_LFG, true);
Push(player);
Push(roles);
lua_newtable(L);
int table = lua_gettop(L);
uint32 counter = 1;
for (uint32 dungeon : dungeons)
{
Eluna::Push(L, dungeon);
lua_rawseti(L, table, counter);
++counter;
}
lua_settop(L, table);
++push_counter;
Push(comment);
return CallAllFunctionsBool(PlayerEventBindings, key);
}