mirror of
https://github.com/araxiaonline/TrinityCore.git
synced 2026-06-15 12:42:43 -04:00
Core/Entities: Phasing rewrite
* Optimized phase visibility checking * Handle all phase flags Closes #16758 Closes #21119
This commit is contained in:
@@ -34,6 +34,7 @@
|
||||
#include "MotionMaster.h"
|
||||
#include "ObjectAccessor.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "PhasingHandler.h"
|
||||
#include "Random.h"
|
||||
#include "SmartAI.h"
|
||||
#include "SpellAuras.h"
|
||||
@@ -1246,7 +1247,12 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
|
||||
break;
|
||||
|
||||
for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr)
|
||||
(*itr)->SetInPhase(e.action.ingamePhaseId.id, true, e.action.ingamePhaseId.apply == 1);
|
||||
{
|
||||
if (e.action.ingamePhaseId.apply == 1)
|
||||
PhasingHandler::AddPhase(*itr, e.action.ingamePhaseId.id, true);
|
||||
else
|
||||
PhasingHandler::RemovePhase(*itr, e.action.ingamePhaseId.id, true);
|
||||
}
|
||||
|
||||
delete targets;
|
||||
break;
|
||||
@@ -1258,11 +1264,13 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
|
||||
if (!targets)
|
||||
break;
|
||||
|
||||
std::set<uint32> phases = sDB2Manager.GetPhasesForGroup(e.action.ingamePhaseGroup.groupId);
|
||||
|
||||
for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr)
|
||||
for (auto phase : phases)
|
||||
(*itr)->SetInPhase(phase, true, e.action.ingamePhaseGroup.apply == 1);
|
||||
{
|
||||
if (e.action.ingamePhaseGroup.apply == 1)
|
||||
PhasingHandler::AddPhaseGroup(*itr, e.action.ingamePhaseGroup.groupId, true);
|
||||
else
|
||||
PhasingHandler::RemovePhaseGroup(*itr, e.action.ingamePhaseGroup.groupId, true);
|
||||
}
|
||||
|
||||
delete targets;
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user