aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Entities/Player
diff options
context:
space:
mode:
authorWyrserth <wyrserth@protonmail.com>2019-07-05 14:11:15 +0200
committerGitHub <noreply@github.com>2019-07-05 14:11:15 +0200
commit12e545f7e2247f91db3fd1e8e2f961982422a147 (patch)
tree0d5fe35be9b5e888e0953cf8625fc89962137f74 /src/server/game/Entities/Player
parentc44fb37f74347e3b6d399c941716971503af4cf8 (diff)
Core/Conditions: allow spellclick conditions to properly work for aura apply/remove (#23527)
Diffstat (limited to 'src/server/game/Entities/Player')
-rw-r--r--src/server/game/Entities/Player/Player.cpp24
-rw-r--r--src/server/game/Entities/Player/Player.h2
2 files changed, 8 insertions, 18 deletions
diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp
index 40399c527be..3b6ec5f0600 100644
--- a/src/server/game/Entities/Player/Player.cpp
+++ b/src/server/game/Entities/Player/Player.cpp
@@ -15960,7 +15960,7 @@ void Player::SendQuestUpdate(uint32 questId)
}
}
- UpdateForQuestWorldObjects();
+ UpdateVisibleGameobjectsOrSpellClicks();
}
QuestGiverStatus Player::GetQuestDialogStatus(Object* questgiver)
@@ -16264,12 +16264,12 @@ void Player::ItemAddedQuestCheck(uint32 entry, uint32 count)
if (CanCompleteQuest(questid))
CompleteQuest(questid);
else if (q_status.ItemCount[j] == reqitemcount) // Send quest update when an objective is completed
- UpdateForQuestWorldObjects();
+ UpdateVisibleGameobjectsOrSpellClicks();
return;
}
}
}
- UpdateForQuestWorldObjects();
+ UpdateVisibleGameobjectsOrSpellClicks();
}
void Player::ItemRemovedQuestCheck(uint32 entry, uint32 count)
@@ -16312,7 +16312,7 @@ void Player::ItemRemovedQuestCheck(uint32 entry, uint32 count)
}
}
}
- UpdateForQuestWorldObjects();
+ UpdateVisibleGameobjectsOrSpellClicks();
}
void Player::KilledMonster(CreatureTemplate const* cInfo, ObjectGuid guid)
@@ -23403,7 +23403,7 @@ bool Player::HasQuestForGO(int32 GOId) const
return false;
}
-void Player::UpdateForQuestWorldObjects()
+void Player::UpdateVisibleGameobjectsOrSpellClicks()
{
if (m_clientGUIDs.empty())
return;
@@ -23430,20 +23430,10 @@ void Player::UpdateForQuestWorldObjects()
auto clickBounds = sObjectMgr->GetSpellClickInfoMapBounds(obj->GetEntry());
for (auto const& clickPair : clickBounds)
{
- //! 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(), clickPair.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;
}
}
}
diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h
index 999398bc987..80b3cd9e0cb 100644
--- a/src/server/game/Entities/Player/Player.h
+++ b/src/server/game/Entities/Player/Player.h
@@ -1285,7 +1285,7 @@ class TC_GAME_API Player : public Unit, public GridObject<Player>
void ReputationChanged2(FactionEntry const* factionEntry);
bool HasQuestForItem(uint32 itemId, uint32 excludeQuestId = 0, bool turnIn = false) const;
bool HasQuestForGO(int32 goId) const;
- void UpdateForQuestWorldObjects();
+ void UpdateVisibleGameobjectsOrSpellClicks();
bool CanShareQuest(uint32 questId) const;
void SendQuestComplete(uint32 questId) const;