[7838] More fixes in pet's levelup spells.

* Fixed not updating levelup spells at warlock pet summon firsy time (overwriting by default original ranks in fact)
* Correctly upgrade/doungrade spell ranks in action bar.
* Fixed spell learning spam at warlock pet re-summon in some cases.

TODO: currently (before this commit and in it) PetSpellInitialize() called too oftern. Maybe possible cache update flag and do it one time somewhere in Pet::Update....
This commit is contained in:
VladimirMangos 2009-05-16 17:01:03 +04:00
parent 8cf9dc035b
commit 122c9c5785
6 changed files with 97 additions and 48 deletions

View file

@ -4792,13 +4792,10 @@ bool ChatHandler::HandleResetLevelCommand(const char * args)
player->InitTalentForLevel();
player->SetUInt32Value(PLAYER_XP,0);
// reset level to summoned pet
Pet* pet = player->GetPet();
if(pet && pet->getPetType()==SUMMON_PET)
{
pet->InitStatsForLevel(1);
pet->InitTalentForLevel();
}
// reset level for pet
if(Pet* pet = player->GetPet())
pet->SynchronizeLevelWithOwner();
return true;
}