mirror of
https://github.com/araxiaonline/TrinityCore.git
synced 2026-06-15 04:32:35 -04:00
Merge branch '4.3.4_phases' of https://github.com/TrinityCore/TrinityCore into 4.3.4
This commit is contained in:
@@ -1045,7 +1045,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
|
||||
delete targets;
|
||||
break;
|
||||
}
|
||||
case SMART_ACTION_SET_INGAME_PHASE_MASK:
|
||||
case SMART_ACTION_SET_INGAME_PHASE_ID:
|
||||
{
|
||||
ObjectList* targets = GetTargets(e, unit);
|
||||
|
||||
@@ -1053,12 +1053,23 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
|
||||
break;
|
||||
|
||||
for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr)
|
||||
{
|
||||
if (IsUnit(*itr))
|
||||
(*itr)->ToUnit()->SetPhaseMask(e.action.ingamePhaseMask.mask, true);
|
||||
else if (IsGameObject(*itr))
|
||||
(*itr)->ToGameObject()->SetPhaseMask(e.action.ingamePhaseMask.mask, true);
|
||||
}
|
||||
(*itr)->SetInPhase(e.action.ingamePhaseId.id, true, e.action.ingamePhaseId.apply == 1);
|
||||
|
||||
delete targets;
|
||||
break;
|
||||
}
|
||||
case SMART_ACTION_SET_INGAME_PHASE_GROUP:
|
||||
{
|
||||
ObjectList* targets = GetTargets(e, unit);
|
||||
|
||||
if (!targets)
|
||||
break;
|
||||
|
||||
std::set<uint32> const& phases = 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);
|
||||
|
||||
delete targets;
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user