mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-18 03:15:41 +00:00
feat(Core/Unit): don't allow additions threat in evade mode and implement AURA_INTERRUPT_FLAG_LEAVE_COMBAT (#3381)
This commit is contained in:
@@ -12796,8 +12796,11 @@ void Unit::ClearInCombat()
|
||||
void Unit::ClearInPetCombat()
|
||||
{
|
||||
RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PET_IN_COMBAT);
|
||||
RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_LEAVE_COMBAT);
|
||||
if (Unit* owner = GetOwner())
|
||||
{
|
||||
owner->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PET_IN_COMBAT);
|
||||
}
|
||||
}
|
||||
|
||||
bool Unit::isTargetableForAttack(bool checkFakeDeath, Unit const* byWho) const
|
||||
@@ -13600,8 +13603,10 @@ float Unit::ApplyTotalThreatModifier(float fThreat, SpellSchoolMask schoolMask)
|
||||
void Unit::AddThreat(Unit* victim, float fThreat, SpellSchoolMask schoolMask, SpellInfo const* threatSpell)
|
||||
{
|
||||
// Only mobs can manage threat lists
|
||||
if (CanHaveThreatList())
|
||||
if (CanHaveThreatList() && !HasUnitState(UNIT_STATE_EVADE))
|
||||
{
|
||||
m_ThreatManager.addThreat(victim, fThreat, schoolMask, threatSpell);
|
||||
}
|
||||
}
|
||||
|
||||
//======================================================================
|
||||
@@ -19482,11 +19487,6 @@ bool Unit::SetDisableGravity(bool disable, bool /*packetOnly = false*/)
|
||||
else
|
||||
{
|
||||
RemoveUnitMovementFlag(MOVEMENTFLAG_DISABLE_GRAVITY);
|
||||
if (!HasUnitMovementFlag(MOVEMENTFLAG_CAN_FLY))
|
||||
{
|
||||
m_movementInfo.SetFallTime(0);
|
||||
//AddUnitMovementFlag(MOVEMENTFLAG_FALLING); // pussywizard: ZOMG!
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -19518,11 +19518,6 @@ bool Unit::SetCanFly(bool enable, bool /*packetOnly = false */)
|
||||
else
|
||||
{
|
||||
RemoveUnitMovementFlag(MOVEMENTFLAG_CAN_FLY | MOVEMENTFLAG_MASK_MOVING_FLY);
|
||||
if (!IsLevitating())
|
||||
{
|
||||
m_movementInfo.SetFallTime(0);
|
||||
//AddUnitMovementFlag(MOVEMENTFLAG_FALLING); // pussywizard: ZOMG!
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
@@ -63,6 +63,7 @@ enum SpellAuraInterruptFlags
|
||||
AURA_INTERRUPT_FLAG_ENTER_PVP_COMBAT = 0x00800000, // 23 removed by entering pvp combat
|
||||
AURA_INTERRUPT_FLAG_DIRECT_DAMAGE = 0x01000000, // 24 removed by any direct damage
|
||||
AURA_INTERRUPT_FLAG_LANDING = 0x02000000, // 25 removed by hitting the ground
|
||||
AURA_INTERRUPT_FLAG_LEAVE_COMBAT = 0x80000000, // 31 removed by leaving combat
|
||||
|
||||
AURA_INTERRUPT_FLAG_NOT_VICTIM = (AURA_INTERRUPT_FLAG_HITBYSPELL | AURA_INTERRUPT_FLAG_TAKE_DAMAGE | AURA_INTERRUPT_FLAG_DIRECT_DAMAGE),
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user