aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Quests
diff options
context:
space:
mode:
authorMeji <alvaro.megias@outlook.com>2024-03-27 21:38:08 +0100
committerGitHub <noreply@github.com>2024-03-27 21:38:08 +0100
commit4913d027bf3b8231b925be3f203feac590bb3607 (patch)
tree830f91b8f86fe9fa653ff6d41be256f850140dbf /src/server/game/Quests
parent1f855ef56336c6a7fd74898e9c9beba77828c69b (diff)
Core/Conditions: Added CONDITION_SOURCE_TYPE_PLAYER_CONDITION (#29832)
Diffstat (limited to 'src/server/game/Quests')
-rw-r--r--src/server/game/Quests/QuestDef.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/server/game/Quests/QuestDef.cpp b/src/server/game/Quests/QuestDef.cpp
index 20306a41081..a77b6f8d3b4 100644
--- a/src/server/game/Quests/QuestDef.cpp
+++ b/src/server/game/Quests/QuestDef.cpp
@@ -151,8 +151,11 @@ void Quest::LoadRewardDisplaySpell(Field* fields)
if (playerConditionId && !sPlayerConditionStore.LookupEntry(playerConditionId))
{
- TC_LOG_ERROR("sql.sql", "Table `quest_reward_display_spell` has non-existing PlayerCondition ({}) set for quest {} and spell {}. Set to 0.", playerConditionId, fields[0].GetUInt32(), spellId);
- playerConditionId = 0;
+ if (!sConditionMgr->HasConditionsForNotGroupedEntry(CONDITION_SOURCE_TYPE_PLAYER_CONDITION, playerConditionId))
+ {
+ TC_LOG_ERROR("sql.sql", "Table `quest_reward_display_spell` has serverside PlayerCondition ({}) set for quest {} and spell {} without conditions. Set to 0.", playerConditionId, fields[0].GetUInt32(), spellId);
+ playerConditionId = 0;
+ }
}
if (type >= AsUnderlyingType(QuestCompleteSpellType::Max))
@@ -484,9 +487,8 @@ void Quest::BuildQuestRewards(WorldPackets::Quest::QuestRewards& rewards, Player
auto displaySpellItr = rewards.SpellCompletionDisplayID.begin();
for (QuestRewardDisplaySpell displaySpell : RewardDisplaySpell)
{
- if (PlayerConditionEntry const* playerCondition = sPlayerConditionStore.LookupEntry(displaySpell.PlayerConditionId))
- if (!ConditionMgr::IsPlayerMeetingCondition(player, playerCondition))
- continue;
+ if (!ConditionMgr::IsPlayerMeetingCondition(player, displaySpell.PlayerConditionId))
+ continue;
*displaySpellItr = displaySpell.SpellId;
if (++displaySpellItr == rewards.SpellCompletionDisplayID.end())