Core/SpellArea: iterate spell_area entries by player's current area instead of quest id. (#17509)
This commit is contained in:
1 parent
b6be6556f6
commit
3fa8965fff
2 files changed
+15
-22
No files matched your search
@@ -14922,7 +14922,7 @@ void Player::AddQuest(Quest const* quest, Object* questGiver)
|
||||
|
||||
StartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_QUEST, quest_id);
|
||||
|
||||
SendQuestUpdate(quest_id);
|
||||
SendQuestUpdate();
|
||||
|
||||
SendQuestGiverStatusMultiple();
|
||||
|
||||
@@ -15174,7 +15174,7 @@ void Player::RewardQuest(Quest const* quest, uint32 reward, Object* questGiver,
|
||||
UpdatePvPState();
|
||||
}
|
||||
|
||||
SendQuestUpdate(quest_id);
|
||||
SendQuestUpdate();
|
||||
|
||||
//lets remove flag for delayed teleports
|
||||
SetCanDelayTeleport(false);
|
||||
@@ -15818,7 +15818,7 @@ void Player::SetQuestStatus(uint32 questId, QuestStatus status, bool update /*=
|
||||
}
|
||||
|
||||
if (update)
|
||||
SendQuestUpdate(questId);
|
||||
SendQuestUpdate();
|
||||
|
||||
sScriptMgr->OnQuestStatusChange(this, questId, status);
|
||||
}
|
||||
@@ -15833,7 +15833,7 @@ void Player::RemoveActiveQuest(uint32 questId, bool update /*= true*/)
|
||||
}
|
||||
|
||||
if (update)
|
||||
SendQuestUpdate(questId);
|
||||
SendQuestUpdate();
|
||||
}
|
||||
|
||||
void Player::RemoveRewardedQuest(uint32 questId, bool update /*= true*/)
|
||||
@@ -15846,33 +15846,26 @@ void Player::RemoveRewardedQuest(uint32 questId, bool update /*= true*/)
|
||||
}
|
||||
|
||||
if (update)
|
||||
SendQuestUpdate(questId);
|
||||
SendQuestUpdate();
|
||||
}
|
||||
|
||||
void Player::SendQuestUpdate(uint32 questId)
|
||||
void Player::SendQuestUpdate()
|
||||
{
|
||||
uint32 zone = 0, area = 0;
|
||||
GetZoneAndAreaId(zone, area);
|
||||
|
||||
SpellAreaForQuestMapBounds saBounds = sSpellMgr->GetSpellAreaForAreaMapBounds(area);
|
||||
|
||||
SpellAreaForQuestMapBounds saBounds = sSpellMgr->GetSpellAreaForQuestMapBounds(questId);
|
||||
if (saBounds.first != saBounds.second)
|
||||
{
|
||||
GetZoneAndAreaId(zone, area);
|
||||
|
||||
for (SpellAreaForAreaMap::const_iterator itr = saBounds.first; itr != saBounds.second; ++itr)
|
||||
if (itr->second->autocast && itr->second->IsFitToRequirements(this, zone, area))
|
||||
if (!HasAura(itr->second->spellId))
|
||||
CastSpell(this, itr->second->spellId, true);
|
||||
}
|
||||
|
||||
saBounds = sSpellMgr->GetSpellAreaForQuestEndMapBounds(questId);
|
||||
if (saBounds.first != saBounds.second)
|
||||
{
|
||||
if (!zone || !area)
|
||||
GetZoneAndAreaId(zone, area);
|
||||
|
||||
for (SpellAreaForAreaMap::const_iterator itr = saBounds.first; itr != saBounds.second; ++itr)
|
||||
{
|
||||
if (!itr->second->IsFitToRequirements(this, zone, area))
|
||||
RemoveAurasDueToSpell(itr->second->spellId);
|
||||
else if (itr->second->autocast)
|
||||
if (!HasAura(itr->second->spellId))
|
||||
CastSpell(this, itr->second->spellId, true);
|
||||
}
|
||||
}
|
||||
|
||||
UpdateForQuestWorldObjects();
|
||||
|
||||
@@ -1563,7 +1563,7 @@ class Player : public Unit, public GridObject<Player>
|
||||
void SetQuestStatus(uint32 questId, QuestStatus status, bool update = true);
|
||||
void RemoveActiveQuest(uint32 questId, bool update = true);
|
||||
void RemoveRewardedQuest(uint32 questId, bool update = true);
|
||||
void SendQuestUpdate(uint32 questId);
|
||||
void SendQuestUpdate();
|
||||
QuestGiverStatus GetQuestDialogStatus(Object* questGiver);
|
||||
|
||||
void SetDailyQuestStatus(uint32 quest_id);
|
||||
|
||||
Reference in new issue
Block a user