mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-15 23:20:36 +01:00
Core/Conditions: Added CONDITION_SOURCE_TYPE_PLAYER_CONDITION (#29832)
This commit is contained in:
@@ -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())
|
||||
|
||||
Reference in New Issue
Block a user