diff options
author | MitchesD <majklprofik@seznam.cz> | 2016-05-17 21:35:54 +0200 |
---|---|---|
committer | MitchesD <majklprofik@seznam.cz> | 2016-05-17 21:35:54 +0200 |
commit | 192c428865fdaacf7a4e73aba4d2c8e8e5f66bf5 (patch) | |
tree | c8f4f3c57a0ff804605562e84c26b750db1dbd16 /src | |
parent | c194daf0b59a820455d65e9f5502a24376731a3c (diff) |
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
Diffstat (limited to 'src')
-rw-r--r-- | src/server/game/Conditions/ConditionMgr.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
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<PhaseInfoStruct>* phases = sObjectMgr->GetPhasesForAreaForLoading(cond->SourceEntry)) { |