Skip to content

Commit

Permalink
NPCBots: Make only the bots attacking a bot using Vanish / Feign Deat…
Browse files Browse the repository at this point in the history
…h drop their target, not the bot using the spell
  • Loading branch information
trickerer committed Nov 8, 2024
1 parent c8c63ac commit cbd486d
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/server/game/Entities/Unit/Unit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5937,11 +5937,6 @@ bool Unit::AttackStop()
if (Creature* creature = ToCreature())
{
creature->SetNoCallAssistance(false);

//npcbot
if (IsNPCBotOrPet())
BotMgr::OnBotAttackStop(creature, victim);
//end npcbot
}

SendMeleeAttackStop(victim);
Expand Down Expand Up @@ -6030,6 +6025,10 @@ void Unit::RemoveAllAttackers()
while (!m_attackers.empty())
{
AttackerSet::iterator iter = m_attackers.begin();
//npcbot
if ((*iter)->IsNPCBotOrPet())
BotMgr::OnBotAttackStop((*iter)->ToCreature(), this);
//end npcbot
if (!(*iter)->AttackStop())
{
TC_LOG_ERROR("entities.unit", "WORLD: Unit has an attacker that isn't attacking it!");
Expand Down

0 comments on commit cbd486d

Please sign in to comment.