From 192c428865fdaacf7a4e73aba4d2c8e8e5f66bf5 Mon Sep 17 00:00:00 2001 From: MitchesD Date: Tue, 17 May 2016 21:35:54 +0200 Subject: Core/ConditionMgr: condition CONDITION_SOURCE_TYPE_PHASE should not break on first phaseID which is equal to condition phase Id, it should iterate over all and check if more areas are trying to apply the same phase * it's required for example for Wandering Isle quests Closes https://github.com/TrinityCore/TrinityCore/issues/17054 --- src/server/game/Conditions/ConditionMgr.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/game/Conditions/ConditionMgr.cpp b/src/server/game/Conditions/ConditionMgr.cpp index 4a0fa1984aa..5494f5a8bb4 100644 --- a/src/server/game/Conditions/ConditionMgr.cpp +++ b/src/server/game/Conditions/ConditionMgr.cpp @@ -1378,6 +1378,7 @@ bool ConditionMgr::addToPhases(Condition* cond) const { if (!cond->SourceEntry) { + bool found = false; PhaseInfo& p = sObjectMgr->GetAreaPhasesForLoading(); for (auto phaseItr = p.begin(); phaseItr != p.end(); ++phaseItr) { @@ -1386,10 +1387,13 @@ bool ConditionMgr::addToPhases(Condition* cond) const if (phase.Id == cond->SourceGroup) { phase.Conditions.push_back(cond); - return true; + found = true; } } } + + if (found) + return true; } else if (std::vector* phases = sObjectMgr->GetPhasesForAreaForLoading(cond->SourceEntry)) { -- cgit v1.2.3