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

@@ -4361,7 +4361,7 @@ void Player::ResurrectPlayer(float restore_percent, bool applySickness)
RemoveAurasDueToSpell(8326); // SPELL_AURA_GHOST
if (GetSession()->IsARecruiter() || (GetSession()->GetRecruiterId() != 0))
SetFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_REFER_A_FRIEND);
SetDynamicFlag(UNIT_DYNFLAG_REFER_A_FRIEND);
setDeathState(ALIVE);
SetMovement(MOVE_LAND_WALK);
@@ -4433,7 +4433,7 @@ void Player::KillPlayer()
setDeathState(CORPSE);
//SetUnitFlag(UNIT_FLAG_NOT_IN_PVP);
SetUInt32Value(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_NONE);
ReplaceAllDynamicFlags(UNIT_DYNFLAG_NONE);
ApplyModFlag(PLAYER_FIELD_BYTES, PLAYER_FIELD_BYTE_RELEASE_TIMER, !sMapStore.LookupEntry(GetMapId())->Instanceable() && !HasAuraType(SPELL_AURA_PREVENT_RESURRECTION));
// 6 minutes until repop at graveyard
@@ -7866,7 +7866,7 @@ void Player::SendLoot(ObjectGuid guid, LootType loot_type)
else
{
// Xinef: Exploit fix
if (!creature->HasFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE))
if (!creature->HasDynamicFlag(UNIT_DYNFLAG_LOOTABLE))
{
SendLootError(guid, LOOT_ERROR_DIDNT_KILL);
return;