From 46b35d308213586c75653be2b9d92d0f0029c738 Mon Sep 17 00:00:00 2001 From: Meji Date: Wed, 27 Mar 2024 21:38:08 +0100 Subject: Core/Conditions: Added CONDITION_SOURCE_TYPE_PLAYER_CONDITION (#29832) (cherry picked from commit 4913d027bf3b8231b925be3f203feac590bb3607) --- src/server/game/Quests/QuestDef.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/server/game/Quests/QuestDef.cpp') diff --git a/src/server/game/Quests/QuestDef.cpp b/src/server/game/Quests/QuestDef.cpp index 5e7a46641f6..1ddcefd2c98 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)) @@ -482,9 +485,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()) -- cgit v1.2.3