diff --git a/zone/aggro.cpp b/zone/aggro.cpp index 612edd47a..862c91605 100644 --- a/zone/aggro.cpp +++ b/zone/aggro.cpp @@ -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(); diff --git a/zone/spells.cpp b/zone/spells.cpp index 0d110a36e..965f96427 100644 --- a/zone/spells.cpp +++ b/zone/spells.cpp @@ -123,21 +123,12 @@ void NPC::SpellProcess() { Mob::SpellProcess(); - if(GetSwarmInfo()){ - Mob *swp_o = GetSwarmInfo()->GetOwner(); - if(!swp_o) - { + if (GetSwarmInfo()) { + if (GetSwarmInfo()->duration->Check(false)) Depop(); - } - - if(GetSwarmInfo()->duration->Check(false)) - { - Depop(); - } Mob *targMob = entity_list.GetMob(GetSwarmInfo()->target); - if(GetSwarmInfo()->target != 0) - { + if (GetSwarmInfo()->target != 0) { if(!targMob || (targMob && targMob->IsCorpse())) Depop(); }