mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-24 22:26:22 +00:00
fix(Core/Combat): Removed some invalid code about auto-acquiring a nearby target if primary target is not detectable by creature. (#8624)
Spells with sanctuary always delete hostile references (if not during encounter). Update visibility should be always forced in case of invisibility/stealth auras. Restored old Shadowmeld code. Fixes #4764 Fixes #7125
This commit is contained in:
@@ -228,8 +228,7 @@ void HostileRefMgr::UpdateVisibility(bool checkThreat)
|
||||
while (ref)
|
||||
{
|
||||
HostileReference* nextRef = ref->next();
|
||||
if ((!checkThreat || ref->GetSource()->getThreatList().size() <= 1) &&
|
||||
!ref->GetSource()->GetOwner()->CanSeeOrDetect(GetOwner()))
|
||||
if ((!checkThreat || ref->GetSource()->getThreatList().size() <= 1))
|
||||
{
|
||||
nextRef = ref->next();
|
||||
ref->removeReference();
|
||||
|
||||
@@ -13896,14 +13896,6 @@ Unit* Creature::SelectVictim()
|
||||
if (GetVehicle())
|
||||
return nullptr;
|
||||
|
||||
// search nearby enemies before evading
|
||||
if (HasReactState(REACT_AGGRESSIVE))
|
||||
{
|
||||
target = SelectNearestTargetInAttackDistance(std::max<float>(m_CombatDistance, ATTACK_DISTANCE));
|
||||
if (target && _CanDetectFeignDeathOf(target) && CanCreatureAttack(target))
|
||||
return target;
|
||||
}
|
||||
|
||||
// pussywizard: not sure why it's here
|
||||
// pussywizard: can't evade when having invisibility aura with duration? o_O
|
||||
Unit::AuraEffectList const& iAuras = GetAuraEffectsByType(SPELL_AURA_MOD_INVISIBILITY);
|
||||
|
||||
@@ -1575,13 +1575,8 @@ void AuraEffect::HandleModInvisibility(AuraApplication const* aurApp, uint8 mode
|
||||
target->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_IMMUNE_OR_LOST_SELECTION);
|
||||
}
|
||||
|
||||
if (!apply && aurApp->GetRemoveMode() == AURA_REMOVE_BY_DEFAULT)
|
||||
{
|
||||
target->UpdateObjectVisibility(target->GetTypeId() == TYPEID_PLAYER || target->GetOwnerGUID().IsPlayer() || target->GetMap()->Instanceable(), true);
|
||||
target->bRequestForcedVisibilityUpdate = false;
|
||||
}
|
||||
else
|
||||
target->UpdateObjectVisibility(target->GetTypeId() == TYPEID_PLAYER || target->GetOwnerGUID().IsPlayer() || target->GetMap()->Instanceable());
|
||||
target->UpdateObjectVisibility(target->GetTypeId() == TYPEID_PLAYER || target->GetOwnerGUID().IsPlayer() || target->GetMap()->Instanceable(), true);
|
||||
target->bRequestForcedVisibilityUpdate = false;
|
||||
}
|
||||
|
||||
void AuraEffect::HandleModStealthDetect(AuraApplication const* aurApp, uint8 mode, bool apply) const
|
||||
@@ -1654,13 +1649,8 @@ void AuraEffect::HandleModStealth(AuraApplication const* aurApp, uint8 mode, boo
|
||||
target->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_IMMUNE_OR_LOST_SELECTION);
|
||||
}
|
||||
|
||||
if (!apply && aurApp->GetRemoveMode() == AURA_REMOVE_BY_DEFAULT)
|
||||
{
|
||||
target->UpdateObjectVisibility((target->GetTypeId() == TYPEID_PLAYER || target->GetOwnerGUID().IsPlayer() || target->GetMap()->Instanceable()), true);
|
||||
target->bRequestForcedVisibilityUpdate = false;
|
||||
}
|
||||
else
|
||||
target->UpdateObjectVisibility(target->GetTypeId() == TYPEID_PLAYER || target->GetOwnerGUID().IsPlayer() || target->GetMap()->Instanceable());
|
||||
target->UpdateObjectVisibility(target->GetTypeId() == TYPEID_PLAYER || target->GetOwnerGUID().IsPlayer() || target->GetMap()->Instanceable(), true);
|
||||
target->bRequestForcedVisibilityUpdate = false;
|
||||
}
|
||||
|
||||
void AuraEffect::HandleModStealthLevel(AuraApplication const* aurApp, uint8 mode, bool apply) const
|
||||
|
||||
Reference in New Issue
Block a user