本文整理汇总了C++中Pet::CleanupActionBar方法的典型用法代码示例。如果您正苦于以下问题:C++ Pet::CleanupActionBar方法的具体用法?C++ Pet::CleanupActionBar怎么用?C++ Pet::CleanupActionBar使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Pet
的用法示例。
在下文中一共展示了Pet::CleanupActionBar方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: HandleLoadPetFromDBSecondCallback
void WorldSession::HandleLoadPetFromDBSecondCallback(LoadPetFromDBQueryHolder* holder)
{
if (!GetPlayer())
return;
Player* owner = GetPlayer();
Pet* pet = owner->GetPet();
if (!pet)
return;
pet->_LoadAuras(holder->GetPreparedResult(PET_LOAD_QUERY_LOADAURAS), holder->GetDiffTime());
bool current = holder->GetCurrent();
uint32 summon_spell_id = pet->GetUInt32Value(UNIT_CREATED_BY_SPELL);
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(summon_spell_id); // CANT BE NULL
bool is_temporary_summoned = spellInfo && spellInfo->GetDuration() > 0;
// load action bar, if data broken will fill later by default spells.
if (!is_temporary_summoned)
{
pet->_LoadSpells(holder->GetPreparedResult(PET_LOAD_QUERY_LOADSPELLS));
pet->InitTalentForLevel(); // re-init to check talent count
pet->_LoadSpellCooldowns(holder->GetPreparedResult(PET_LOAD_QUERY_LOADSPELLCOOLDOWN));
pet->LearnPetPassives();
pet->InitLevelupSpellsForLevel();
pet->CastPetAuras(current);
pet->GetCharmInfo()->LoadPetActionBar(holder->GetActionBar()); // action bar stored in already read string
}
pet->CleanupActionBar(); // remove unknown spells from action bar after load
owner->PetSpellInitialize();
owner->SendTalentsInfoData(true);
if (owner->GetGroup())
owner->SetGroupUpdateFlag(GROUP_UPDATE_PET);
//set last used pet number (for use in BG's)
if (owner->GetTypeId() == TYPEID_PLAYER && pet->isControlled() && !pet->isTemporarySummoned() && (pet->getPetType() == SUMMON_PET || pet->getPetType() == HUNTER_PET))
{
owner->ToPlayer()->SetLastPetNumber(holder->GetPetNumber());
owner->SetLastPetSpell(pet->GetUInt32Value(UNIT_CREATED_BY_SPELL));
}
if (pet->getPetType() == SUMMON_PET && !current) //all (?) summon pets come with full health when called, but not when they are current
{
pet->SetPower(POWER_MANA, pet->GetMaxPower(POWER_MANA));
pet->SetHealth(pet->GetMaxHealth());
}
else
{
if (!holder->GetSavedHealth() && pet->getPetType() == HUNTER_PET && pet->GetAsynchLoadType() != PET_LOAD_SUMMON_DEAD_PET)
pet->setDeathState(JUST_DIED);
else
{
pet->SetHealth(holder->GetSavedHealth() > pet->GetMaxHealth() ? pet->GetMaxHealth() : holder->GetSavedHealth());
pet->SetPower(POWER_MANA, holder->GetSavedMana() > pet->GetMaxPower(POWER_MANA) ? pet->GetMaxPower(POWER_MANA) : holder->GetSavedMana());
}
}
pet->SetLoading(false);
owner->SetTemporaryUnsummonedPetNumber(0); // clear this only if pet is loaded successfuly
// current
if (current && owner->IsPetNeedBeTemporaryUnsummoned())
{
owner->UnsummonPetTemporaryIfAny();
return;
}
pet->HandleAsynchLoadSucceed();
return;
}