aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorariel- <ariel-@users.noreply.github.com>2017-04-09 18:43:35 -0300
committerariel- <ariel-@users.noreply.github.com>2017-04-09 18:43:35 -0300
commit214b8e53c5598695915c1392702e059d79cfc260 (patch)
tree1cd58aa214305abafd98ece0a0c5bf28f095177b /src
parent6c3eaff81ddaf076ba070ca71b90a5ca713c4a0e (diff)
Core/Quest: fix RewardNextQuest being used to condition previous quests in chain
Diffstat (limited to 'src')
-rw-r--r--src/server/game/Entities/Player/Player.cpp36
-rw-r--r--src/server/game/Entities/Player/Player.h1
-rw-r--r--src/server/game/Globals/ObjectMgr.cpp6
-rw-r--r--src/server/game/Quests/QuestDef.h1
4 files changed, 4 insertions, 40 deletions
diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp
index 33dfd479c3b..2eb6e1cbe5a 100644
--- a/src/server/game/Entities/Player/Player.cpp
+++ b/src/server/game/Entities/Player/Player.cpp
@@ -14748,7 +14748,7 @@ bool Player::CanSeeStartQuest(Quest const* quest)
if (!DisableMgr::IsDisabledFor(DISABLE_TYPE_QUEST, quest->GetQuestId(), this) && SatisfyQuestClass(quest, false) && SatisfyQuestRace(quest, false) &&
SatisfyQuestSkill(quest, false) && SatisfyQuestExclusiveGroup(quest, false) && SatisfyQuestReputation(quest, false) &&
SatisfyQuestDependentQuests(quest, false) && SatisfyQuestNextChain(quest, false) &&
- SatisfyQuestPrevChain(quest, false) && SatisfyQuestDay(quest, false) && SatisfyQuestWeek(quest, false) &&
+ SatisfyQuestDay(quest, false) && SatisfyQuestWeek(quest, false) &&
SatisfyQuestMonth(quest, false) && SatisfyQuestSeasonal(quest, false))
{
return getLevel() + sWorld->getIntConfig(CONFIG_QUEST_HIGH_LEVEL_HIDE_DIFF) >= quest->GetMinLevel();
@@ -14764,7 +14764,7 @@ bool Player::CanTakeQuest(Quest const* quest, bool msg)
&& SatisfyQuestClass(quest, msg) && SatisfyQuestRace(quest, msg) && SatisfyQuestLevel(quest, msg)
&& SatisfyQuestSkill(quest, msg) && SatisfyQuestReputation(quest, msg)
&& SatisfyQuestDependentQuests(quest, msg) && SatisfyQuestTimed(quest, msg)
- && SatisfyQuestNextChain(quest, msg) && SatisfyQuestPrevChain(quest, msg)
+ && SatisfyQuestNextChain(quest, msg)
&& SatisfyQuestDay(quest, msg) && SatisfyQuestWeek(quest, msg)
&& SatisfyQuestMonth(quest, msg) && SatisfyQuestSeasonal(quest, msg)
&& SatisfyQuestConditions(quest, msg);
@@ -15769,38 +15769,6 @@ bool Player::SatisfyQuestNextChain(Quest const* qInfo, bool msg) const
return true;
}
-bool Player::SatisfyQuestPrevChain(Quest const* qInfo, bool msg)
-{
- // No previous quest in chain
- if (qInfo->PrevChainQuests.empty())
- return true;
-
- for (uint32 prevQuestId : qInfo->PrevChainQuests)
- {
- auto itr = m_QuestStatus.find(prevQuestId);
-
- // If any of the previous quests in chain active, return false
- if (itr != m_QuestStatus.end() && itr->second.Status != QUEST_STATUS_NONE)
- {
- if (msg)
- {
- SendCanTakeQuestResponse(INVALIDREASON_DONT_HAVE_REQ);
- TC_LOG_DEBUG("misc", "Player::SatisfyQuestNextChain: Sent INVALIDREASON_DONT_HAVE_REQ (QuestID: %u) because player '%s' (%s) already did or started next quest in chain.",
- qInfo->GetQuestId(), GetName().c_str(), GetGUID().ToString().c_str());
- }
- return false;
- }
-
- // check for all quests further down the chain
- // only necessary if there are quest chains with more than one quest that can be skipped
- //if (!SatisfyQuestPrevChain(prevId, msg))
- // return false;
- }
-
- // No previous quest in chain active
- return true;
-}
-
bool Player::SatisfyQuestDay(Quest const* qInfo, bool msg) const
{
if (!qInfo->IsDaily() && !qInfo->IsDFQuest())
diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h
index 654811a58b5..c251681eb09 100644
--- a/src/server/game/Entities/Player/Player.h
+++ b/src/server/game/Entities/Player/Player.h
@@ -1360,7 +1360,6 @@ class TC_GAME_API Player : public Unit, public GridObject<Player>
bool SatisfyQuestTimed(Quest const* qInfo, bool msg) const;
bool SatisfyQuestExclusiveGroup(Quest const* qInfo, bool msg) const;
bool SatisfyQuestNextChain(Quest const* qInfo, bool msg) const;
- bool SatisfyQuestPrevChain(Quest const* qInfo, bool msg);
bool SatisfyQuestDay(Quest const* qInfo, bool msg) const;
bool SatisfyQuestWeek(Quest const* qInfo, bool msg) const;
bool SatisfyQuestMonth(Quest const* qInfo, bool msg) const;
diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp
index 9ed9ef05f68..0b82a4b60c7 100644
--- a/src/server/game/Globals/ObjectMgr.cpp
+++ b/src/server/game/Globals/ObjectMgr.cpp
@@ -4579,8 +4579,6 @@ void ObjectMgr::LoadQuests()
qinfo->GetQuestId(), qinfo->_rewardNextQuest, qinfo->_rewardNextQuest);
qinfo->_rewardNextQuest = 0;
}
- else
- qNextItr->second->PrevChainQuests.push_back(qinfo->GetQuestId());
}
// fill additional data stores
@@ -4592,9 +4590,9 @@ void ObjectMgr::LoadQuests()
if (qinfo->_nextQuestId)
{
- auto qNextItr = _questTemplates.find(qinfo->GetNextQuestId());
+ auto qNextItr = _questTemplates.find(qinfo->_nextQuestId);
if (qNextItr == _questTemplates.end())
- TC_LOG_ERROR("sql.sql", "Quest %u has NextQuestId %u, but no such quest", qinfo->GetQuestId(), qinfo->GetNextQuestId());
+ TC_LOG_ERROR("sql.sql", "Quest %u has NextQuestId %u, but no such quest", qinfo->GetQuestId(), qinfo->_nextQuestId);
else
qNextItr->second->DependentPreviousQuests.push_back(qinfo->GetQuestId());
}
diff --git a/src/server/game/Quests/QuestDef.h b/src/server/game/Quests/QuestDef.h
index 51f7c8bf7a6..24925b064c3 100644
--- a/src/server/game/Quests/QuestDef.h
+++ b/src/server/game/Quests/QuestDef.h
@@ -316,7 +316,6 @@ class TC_GAME_API Quest
WorldPacket BuildQueryData(LocaleConstant loc) const;
std::vector<uint32> DependentPreviousQuests;
- std::vector<uint32> PrevChainQuests;
WorldPacket QueryData[TOTAL_LOCALES];
// cached data