feat(Core/Unit): New helpers for DynamicFlags (#11230)

* feat(Core/Unit): New helpers for DynamicFlags

* cherry-pick commit (d611925dc7)

Co-Authored-By: Shauren <shauren.trinity@gmail.com>

* oopsie

Co-authored-by: Shauren <shauren.trinity@gmail.com>
This commit is contained in:
Kitzunu
2022-04-01 12:14:29 +02:00
committed by GitHub
parent 45577d30ca
commit 535c7451a2
38 changed files with 85 additions and 73 deletions

View File

@@ -2483,7 +2483,7 @@ void AuraEffect::HandleFeignDeath(AuraApplication const* aurApp, uint8 mode, boo
// blizz like 2.0.x
target->SetUnitFlag2(UNIT_FLAG2_FEIGN_DEATH);
// blizz like 2.0.x
target->SetFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_DEAD);
target->SetDynamicFlag(UNIT_DYNFLAG_DEAD);
target->AddUnitState(UNIT_STATE_DIED);
}
@@ -2500,7 +2500,7 @@ void AuraEffect::HandleFeignDeath(AuraApplication const* aurApp, uint8 mode, boo
// blizz like 2.0.x
target->RemoveUnitFlag2(UNIT_FLAG2_FEIGN_DEATH);
// blizz like 2.0.x
target->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_DEAD);
target->RemoveDynamicFlag(UNIT_DYNFLAG_DEAD);
target->ClearUnitState(UNIT_STATE_DIED);
}
@@ -2746,12 +2746,12 @@ void AuraEffect::HandleAuraModStalked(AuraApplication const* aurApp, uint8 mode,
// used by spells: Hunter's Mark, Mind Vision, Syndicate Tracker (MURP) DND
if (apply)
target->SetFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_TRACK_UNIT);
target->SetDynamicFlag(UNIT_DYNFLAG_TRACK_UNIT);
else
{
// do not remove unit flag if there are more than this auraEffect of that kind on unit on unit
if (!target->HasAuraType(GetAuraType()))
target->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_TRACK_UNIT);
target->RemoveDynamicFlag(UNIT_DYNFLAG_TRACK_UNIT);
}
// call functions which may have additional effects after chainging state of unit