mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 04:37:00 +00:00
[10769] Fixed trainer flags uses for pet trainers.
* Not exclude trainer flags for client for pet trainers. * Not report error for pet trianers empty spell lists. TODO: * Add check for redundent trainer spell data for pet trainers at server startup * Need hide train gossip option for pet trainers, but currently without it gossip window not open for pet trainer by some unknown reason.
This commit is contained in:
parent
24d410701f
commit
ce09cb70a2
3 changed files with 38 additions and 18 deletions
|
|
@ -12764,6 +12764,11 @@ void Player::PrepareGossipMenu(WorldObject *pSource, uint32 menuId)
|
|||
break;
|
||||
}
|
||||
case GOSSIP_OPTION_TRAINER:
|
||||
// pet trainers not have spells in fact now
|
||||
/* FIXME: gossip menu with single unlearn pet talents option not show by some reason
|
||||
if (pCreature->GetCreatureInfo()->trainer_type == TRAINER_TYPE_PETS)
|
||||
hasMenuItem = false;
|
||||
else */
|
||||
if (!pCreature->IsTrainerOf(this, false))
|
||||
hasMenuItem = false;
|
||||
break;
|
||||
|
|
@ -12772,7 +12777,14 @@ void Player::PrepareGossipMenu(WorldObject *pSource, uint32 menuId)
|
|||
hasMenuItem = false;
|
||||
break;
|
||||
case GOSSIP_OPTION_UNLEARNPETSKILLS:
|
||||
if (!GetPet() || GetPet()->getPetType() != HUNTER_PET || GetPet()->m_spells.size() <= 1 || pCreature->GetCreatureInfo()->trainer_type != TRAINER_TYPE_PETS || pCreature->GetCreatureInfo()->trainer_class != CLASS_HUNTER)
|
||||
if (pCreature->GetCreatureInfo()->trainer_type != TRAINER_TYPE_PETS || pCreature->GetCreatureInfo()->trainer_class != CLASS_HUNTER)
|
||||
hasMenuItem = false;
|
||||
else if (Pet * pet = GetPet())
|
||||
{
|
||||
if (pet->getPetType() != HUNTER_PET || pet->m_spells.size() <= 1)
|
||||
hasMenuItem = false;
|
||||
}
|
||||
else
|
||||
hasMenuItem = false;
|
||||
break;
|
||||
case GOSSIP_OPTION_TAXIVENDOR:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue