mirror of
https://github.com/EQEmu/Server.git
synced 2026-09-02 08:26:36 +00:00
Fix NPC swarm pets despawning on owner death
Fix NPC swarm pets IsAttackAllowed logic
This commit is contained in:
@@ -513,6 +513,14 @@ bool Mob::IsAttackAllowed(Mob *target, bool isSpellAttack)
|
||||
else if(our_owner && our_owner == target)
|
||||
return false;
|
||||
|
||||
// invalidate for swarm pets for later on if their owner is a corpse
|
||||
if (IsNPC() && CastToNPC()->GetSwarmInfo() && our_owner &&
|
||||
our_owner->IsCorpse() && !our_owner->IsPlayerCorpse())
|
||||
our_owner = nullptr;
|
||||
if (target->IsNPC() && target->CastToNPC()->GetSwarmInfo() && target_owner &&
|
||||
target_owner->IsCorpse() && !target_owner->IsPlayerCorpse())
|
||||
target_owner = nullptr;
|
||||
|
||||
//cannot hurt untargetable mobs
|
||||
bodyType bt = target->GetBodyType();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user