refactor(Core): Clean-up after FD (#8586)

This commit is contained in:
patou01
2021-11-28 07:04:14 +01:00
committed by GitHub
parent 1a27f606f1
commit 801a20fce2
10 changed files with 20 additions and 25 deletions

View File

@@ -318,7 +318,7 @@ HostileReference* ThreatContainer::selectNextVictim(Creature* attacker, HostileR
if (currentVictim)
{
Unit* cvUnit = currentVictim->getTarget();
if (!attacker->_CanDetectFeignDeathOf(cvUnit) || !attacker->CanCreatureAttack(cvUnit)) // pussywizard: if currentVictim is not valid => don't compare the threat with it, just take the highest threat valid target
if (!attacker->CanCreatureAttack(cvUnit)) // pussywizard: if currentVictim is not valid => don't compare the threat with it, just take the highest threat valid target
currentVictim = nullptr;
else if (cvUnit->IsImmunedToDamageOrSchool(attacker->GetMeleeDamageSchoolMask()) || cvUnit->HasNegativeAuraWithInterruptFlag(AURA_INTERRUPT_FLAG_TAKE_DAMAGE)) // pussywizard: no 10%/30% if currentVictim is immune to damage or has auras breakable by damage
currentVictim = nullptr;
@@ -353,7 +353,7 @@ HostileReference* ThreatContainer::selectNextVictim(Creature* attacker, HostileR
}
// pussywizard: skip not valid targets
if (attacker->_CanDetectFeignDeathOf(target) && attacker->CanCreatureAttack(target))
if (attacker->CanCreatureAttack(target))
{
if (currentVictim) // pussywizard: if not nullptr then target must have 10%/30% more threat
{