mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-02-01 01:53:47 +00:00
feat(Core/Players): PlayerFlag helpers (#11294)
* feat(Core/Players): PlayerFlag helpers * Update Player.h * fix build
This commit is contained in:
@@ -1764,7 +1764,7 @@ void AuraEffect::HandleAuraGhost(AuraApplication const* aurApp, uint8 mode, bool
|
||||
|
||||
if (apply)
|
||||
{
|
||||
target->SetFlag(PLAYER_FLAGS, PLAYER_FLAGS_GHOST);
|
||||
target->ToPlayer()->SetPlayerFlag(PLAYER_FLAGS_GHOST);
|
||||
target->m_serverSideVisibility.SetValue(SERVERSIDE_VISIBILITY_GHOST, GHOST_VISIBILITY_GHOST);
|
||||
target->m_serverSideVisibilityDetect.SetValue(SERVERSIDE_VISIBILITY_GHOST, GHOST_VISIBILITY_GHOST);
|
||||
}
|
||||
@@ -1773,7 +1773,7 @@ void AuraEffect::HandleAuraGhost(AuraApplication const* aurApp, uint8 mode, bool
|
||||
if (target->HasAuraType(SPELL_AURA_GHOST))
|
||||
return;
|
||||
|
||||
target->RemoveFlag(PLAYER_FLAGS, PLAYER_FLAGS_GHOST);
|
||||
target->ToPlayer()->RemovePlayerFlag(PLAYER_FLAGS_GHOST);
|
||||
target->m_serverSideVisibility.SetValue(SERVERSIDE_VISIBILITY_GHOST, GHOST_VISIBILITY_ALIVE);
|
||||
target->m_serverSideVisibilityDetect.SetValue(SERVERSIDE_VISIBILITY_GHOST, GHOST_VISIBILITY_ALIVE);
|
||||
}
|
||||
@@ -2671,13 +2671,13 @@ void AuraEffect::HandleAuraAllowOnlyAbility(AuraApplication const* aurApp, uint8
|
||||
if (target->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
if (apply)
|
||||
target->SetFlag(PLAYER_FLAGS, PLAYER_ALLOW_ONLY_ABILITY);
|
||||
target->ToPlayer()->SetPlayerFlag(PLAYER_ALLOW_ONLY_ABILITY);
|
||||
else
|
||||
{
|
||||
// do not remove unit flag if there are more than this auraEffect of that kind on unit on unit
|
||||
if (target->HasAuraType(SPELL_AURA_ALLOW_ONLY_ABILITY))
|
||||
return;
|
||||
target->RemoveFlag(PLAYER_FLAGS, PLAYER_ALLOW_ONLY_ABILITY);
|
||||
target->ToPlayer()->RemovePlayerFlag(PLAYER_ALLOW_ONLY_ABILITY);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5392,7 +5392,7 @@ SpellCastResult Spell::CheckCast(bool strict)
|
||||
if (m_caster->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
//can cast triggered (by aura only?) spells while have this flag
|
||||
if (!(_triggeredCastFlags & TRIGGERED_IGNORE_CASTER_AURASTATE) && m_caster->ToPlayer()->HasFlag(PLAYER_FLAGS, PLAYER_ALLOW_ONLY_ABILITY))
|
||||
if (!(_triggeredCastFlags & TRIGGERED_IGNORE_CASTER_AURASTATE) && m_caster->ToPlayer()->HasPlayerFlag(PLAYER_ALLOW_ONLY_ABILITY))
|
||||
return SPELL_FAILED_SPELL_IN_PROGRESS;
|
||||
|
||||
if (!(_triggeredCastFlags & TRIGGERED_IGNORE_SPELL_AND_CATEGORY_CD) && m_caster->ToPlayer()->HasSpellCooldown(m_spellInfo->Id))
|
||||
|
||||
@@ -4230,7 +4230,7 @@ void Spell::EffectStuck(SpellEffIndex /*effIndex*/)
|
||||
return;
|
||||
|
||||
// xinef: player is in corpse
|
||||
if (!target->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_GHOST))
|
||||
if (!target->HasPlayerFlag(PLAYER_FLAGS_GHOST))
|
||||
target->BuildPlayerRepop();
|
||||
target->RepopAtGraveyard();
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user