Core/Conditions: allow spellclick conditions to properly work for aura apply/remove (#23527)
# Conflicts: # src/server/game/Entities/Player/Player.cpp
This commit is contained in:
1 parent
75ae86d062
commit
3cd1fa44ef
6 files changed
+34
-25
No files matched your search
@@ -16231,7 +16231,7 @@ void Player::SendQuestUpdate(uint32 questId)
|
||||
}
|
||||
}
|
||||
|
||||
UpdateForQuestWorldObjects();
|
||||
UpdateVisibleGameobjectsOrSpellClicks();
|
||||
PhasingHandler::OnConditionChange(this);
|
||||
}
|
||||
|
||||
@@ -16525,17 +16525,13 @@ void Player::ItemAddedQuestCheck(uint32 entry, uint32 count)
|
||||
{
|
||||
q_status.ItemCount[j] = std::min<uint16>(q_status.ItemCount[j] + count, reqitemcount);
|
||||
m_QuestStatusSave[questid] = QUEST_DEFAULT_SAVE_TYPE;
|
||||
|
||||
//SendQuestUpdateAddItem(qInfo, j, additemcount);
|
||||
// FIXME: verify if there's any packet sent updating item
|
||||
}
|
||||
if (CanCompleteQuest(questid))
|
||||
CompleteQuest(questid);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
UpdateForQuestWorldObjects();
|
||||
UpdateVisibleGameobjectsOrSpellClicks();
|
||||
}
|
||||
|
||||
void Player::ItemRemovedQuestCheck(uint32 entry, uint32 count)
|
||||
@@ -16578,7 +16574,7 @@ void Player::ItemRemovedQuestCheck(uint32 entry, uint32 count)
|
||||
}
|
||||
}
|
||||
}
|
||||
UpdateForQuestWorldObjects();
|
||||
UpdateVisibleGameobjectsOrSpellClicks();
|
||||
}
|
||||
|
||||
void Player::KilledMonster(CreatureTemplate const* cInfo, ObjectGuid guid)
|
||||
@@ -24680,7 +24676,7 @@ bool Player::HasQuestForGO(int32 GOId) const
|
||||
return false;
|
||||
}
|
||||
|
||||
void Player::UpdateForQuestWorldObjects()
|
||||
void Player::UpdateVisibleGameobjectsOrSpellClicks()
|
||||
{
|
||||
if (m_clientGUIDs.empty())
|
||||
return;
|
||||
@@ -24707,20 +24703,10 @@ void Player::UpdateForQuestWorldObjects()
|
||||
SpellClickInfoMapBounds clickPair = sObjectMgr->GetSpellClickInfoMapBounds(obj->GetEntry());
|
||||
for (SpellClickInfoContainer::const_iterator _itr = clickPair.first; _itr != clickPair.second; ++_itr)
|
||||
{
|
||||
//! This code doesn't look right, but it was logically converted to condition system to do the exact
|
||||
//! same thing it did before. It definitely needs to be overlooked for intended functionality.
|
||||
if (ConditionContainer const* conds = sConditionMgr->GetConditionsForSpellClickEvent(obj->GetEntry(), _itr->second.spellId))
|
||||
{
|
||||
bool buildUpdateBlock = false;
|
||||
for (ConditionContainer::const_iterator jtr = conds->begin(); jtr != conds->end() && !buildUpdateBlock; ++jtr)
|
||||
if ((*jtr)->ConditionType == CONDITION_QUESTREWARDED || (*jtr)->ConditionType == CONDITION_QUESTTAKEN || (*jtr)->ConditionType == CONDITION_QUEST_COMPLETE)
|
||||
buildUpdateBlock = true;
|
||||
|
||||
if (buildUpdateBlock)
|
||||
{
|
||||
obj->BuildValuesUpdateBlockForPlayer(&udata, this);
|
||||
break;
|
||||
}
|
||||
obj->BuildValuesUpdateBlockForPlayer(&udata, this);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user