aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Quests/QuestDef.cpp
diff options
context:
space:
mode:
authorMeji <alvaro.megias@outlook.com>2024-03-27 21:38:08 +0100
committerfunjoker <funjoker109@gmail.com>2024-03-28 20:36:23 +0100
commit46b35d308213586c75653be2b9d92d0f0029c738 (patch)
tree8059773be097703004ccff41412898fb3283088f /src/server/game/Quests/QuestDef.cpp
parent8589ece4f4b7450a10174970c68896cf9d376166 (diff)
Core/Conditions: Added CONDITION_SOURCE_TYPE_PLAYER_CONDITION (#29832)
(cherry picked from commit 4913d027bf3b8231b925be3f203feac590bb3607)
Diffstat (limited to 'src/server/game/Quests/QuestDef.cpp')
-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 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())