[Attack target] Cancel mount aura and remove within dist check

This commit is contained in:
Yunfan Li
2024-07-11 11:28:57 +08:00
parent 80b7f18841
commit 53c4198afd
2 changed files with 2 additions and 2 deletions

View File

@@ -95,7 +95,7 @@ bool AttackAction::Attack(Unit* target, bool with_pet /*true*/)
return false; return false;
} }
if (bot->IsMounted() && bot->IsWithinLOSInMap(target) && sServerFacade->GetDistance2d(bot, target) < 40.0f) if (bot->IsMounted() && bot->IsWithinLOSInMap(target))
{ {
WorldPacket emptyPacket; WorldPacket emptyPacket;
bot->GetSession()->HandleCancelMountAuraOpcode(emptyPacket); bot->GetSession()->HandleCancelMountAuraOpcode(emptyPacket);

View File

@@ -172,7 +172,7 @@ bool AttackersValue::IsPossibleTarget(Unit* attacker, Player* bot, float range)
// (inCannon || !attacker->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE)) && attacker->CanSeeOrDetect(bot) && // (inCannon || !attacker->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE)) && attacker->CanSeeOrDetect(bot) &&
// !(attacker->HasUnitState(UNIT_STATE_STUNNED) && botAI->HasAura("shackle undead", attacker)) && !((attacker->IsPolymorphed() || botAI->HasAura("sap", attacker) || /*attacker->IsCharmed() ||*/ attacker->isFeared()) && !rti) && // !(attacker->HasUnitState(UNIT_STATE_STUNNED) && botAI->HasAura("shackle undead", attacker)) && !((attacker->IsPolymorphed() || botAI->HasAura("sap", attacker) || /*attacker->IsCharmed() ||*/ attacker->isFeared()) && !rti) &&
/*!sServerFacade->IsInRoots(attacker) &&*/ /*!sServerFacade->IsInRoots(attacker) &&*/
!attacker->IsFriendlyTo(bot) && bot->IsWithinDistInMap(attacker, range) && !attacker->IsFriendlyTo(bot) &&
!attacker->HasAuraType(SPELL_AURA_SPIRIT_OF_REDEMPTION) && !attacker->HasAuraType(SPELL_AURA_SPIRIT_OF_REDEMPTION) &&
// !(attacker->GetGUID().IsPet() && enemy) && // !(attacker->GetGUID().IsPet() && enemy) &&
!(attacker->GetCreatureType() == CREATURE_TYPE_CRITTER && !attacker->IsInCombat()) && !(attacker->GetCreatureType() == CREATURE_TYPE_CRITTER && !attacker->IsInCombat()) &&