mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-15 10:00:28 +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;
|
||||
|
||||
Reference in New Issue
Block a user