feat(Core/Unit): New helpers for DynamicFlags (#11230)
* feat(Core/Unit): New helpers for DynamicFlags * cherry-pick commit (https://github.com/TrinityCore/TrinityCore/commit/d611925dc7ab2b3f19c5ee9e0f75b8dfb6de1291) Co-Authored-By: Shauren <shauren.trinity@gmail.com> * oopsie Co-authored-by: Shauren <shauren.trinity@gmail.com>
This commit is contained in:
@@ -48,14 +48,14 @@ void PossessedAI::UpdateAI(uint32 /*diff*/)
|
||||
void PossessedAI::JustDied(Unit* /*u*/)
|
||||
{
|
||||
// We died while possessed, disable our loot
|
||||
me->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
|
||||
me->RemoveDynamicFlag(UNIT_DYNFLAG_LOOTABLE);
|
||||
}
|
||||
|
||||
void PossessedAI::KilledUnit(Unit* /*victim*/)
|
||||
{
|
||||
// We killed a creature, disable victim's loot
|
||||
//if (victim->GetTypeId() == TYPEID_UNIT)
|
||||
// victim->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
|
||||
// victim->RemoveDynamicFlag(UNIT_DYNFLAG_LOOTABLE);
|
||||
}
|
||||
|
||||
void CritterAI::DamageTaken(Unit*, uint32&, DamageEffectType, SpellSchoolMask)
|
||||
|
||||
@@ -2428,7 +2428,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
|
||||
|
||||
for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr)
|
||||
if (IsUnit(*itr))
|
||||
(*itr)->ToUnit()->SetUInt32Value(UNIT_DYNAMIC_FLAGS, e.action.flag.flag);
|
||||
(*itr)->ToUnit()->ReplaceAllDynamicFlags(e.action.flag.flag);
|
||||
|
||||
delete targets;
|
||||
break;
|
||||
@@ -2441,7 +2441,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
|
||||
|
||||
for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr)
|
||||
if (IsUnit(*itr))
|
||||
(*itr)->ToUnit()->SetFlag(UNIT_DYNAMIC_FLAGS, e.action.flag.flag);
|
||||
(*itr)->ToUnit()->SetDynamicFlag(e.action.flag.flag);
|
||||
|
||||
delete targets;
|
||||
break;
|
||||
@@ -2454,7 +2454,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
|
||||
|
||||
for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr)
|
||||
if (IsUnit(*itr))
|
||||
(*itr)->ToUnit()->RemoveFlag(UNIT_DYNAMIC_FLAGS, e.action.flag.flag);
|
||||
(*itr)->ToUnit()->RemoveDynamicFlag(e.action.flag.flag);
|
||||
|
||||
delete targets;
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user