Skip to content

Commit

Permalink
Implement AURA_INTERRUPT_FLAG_LEAVE_COMBAT
Browse files Browse the repository at this point in the history
(based on cmangos/mangos-wotlk@98c19de7a)

Signed-off-by: Xfurry <xfurry.cmangos@outlook.com>
  • Loading branch information
boxa authored and xfurry committed Dec 10, 2017
1 parent 3ecd445 commit e448491
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions src/game/Unit.cpp
Expand Up @@ -9066,6 +9066,8 @@ void Unit::ClearInCombat()
}
else
((Player*)this)->UpdatePotionCooldown();

RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_LEAVE_COMBAT);
}

bool Unit::isTargetableForAttack(bool inverseAlive /*=false*/) const
Expand Down Expand Up @@ -9873,7 +9875,7 @@ bool Unit::IsTargetUnderControl(Unit const& target) const

if (!charmerGuid)
return false;

if (target.GetCharmerGuid() == charmerGuid)
return true;

Expand Down Expand Up @@ -13019,7 +13021,7 @@ Unit* Unit::TakePossessOf(SpellEntry const* spellEntry, SummonPropertiesEntry co

// set temp possess ai (creature will not be able to react by itself)
charmInfo->SetCharmState("PossessedAI");

if (player)
{
// Initialize pet bar
Expand Down Expand Up @@ -13098,7 +13100,7 @@ bool Unit::TakePossessOf(Unit* possessed)
return true;
}
}

// player pet is unsmumoned while possessing
player->UnsummonPetTemporaryIfAny();

Expand Down
2 changes: 1 addition & 1 deletion src/game/Unit.h
Expand Up @@ -97,7 +97,7 @@ enum SpellAuraInterruptFlags
AURA_INTERRUPT_FLAG_ENTER_COMBAT2 = 0x10000000, // 28
AURA_INTERRUPT_FLAG_UNK29 = 0x20000000, // 29
AURA_INTERRUPT_FLAG_UNK30 = 0x40000000, // 30
AURA_INTERRUPT_FLAG_UNK31 = 0x80000000, // 31
AURA_INTERRUPT_FLAG_LEAVE_COMBAT = 0x80000000, // 31 removed by leaving combat
};

enum SpellPartialResist
Expand Down

0 comments on commit e448491

Please sign in to comment.