as below function include the SendTalentsInfoData(true); so the player->SendTalentsInfoData(true); not need
void Player::ResetPetTalents()
{
// This needs another gossip option + NPC text as a confirmation.
// The confirmation gossip listid has the text: "Yes, please do."
Pet* pet = GetPet();
if (!pet || pet->getPetType() != HUNTER_PET || pet->m_usedTalentCount == 0)
return;
CharmInfo* charmInfo = pet->GetCharmInfo();
if (!charmInfo)
{
LOG_ERROR("entities.player", "Object ({}) is considered pet-like but doesn't have a charminfo!", pet->GetGUID().ToString());
return;
}
pet->resetTalents();
SendTalentsInfoData(true);
}
So I think only call player->ResetPetTalents(); and do nothing will fix the crash, or #ifndef azerothcore use player->ResetPetTalents(); only?
int ResetPetTalents(lua_State* /*L*/, Player* player)
{
player->ResetPetTalents();
return 0;
}
now the function will case the server crash
if change to below code, the crash will not action, and work ok
as below function include the SendTalentsInfoData(true); so the player->SendTalentsInfoData(true); not need
So I think only call
player->ResetPetTalents();
and do nothing will fix the crash, or#ifndef azerothcore
useplayer->ResetPetTalents();
only?