mirror of
https://github.com/EQEmu/Server.git
synced 2026-04-03 21:42:26 +00:00
Fix NPC swarm pets despawning on owner death
Fix NPC swarm pets IsAttackAllowed logic
This commit is contained in:
parent
3d5f99e14a
commit
822a1b1003
@ -513,6 +513,14 @@ bool Mob::IsAttackAllowed(Mob *target, bool isSpellAttack)
|
|||||||
else if(our_owner && our_owner == target)
|
else if(our_owner && our_owner == target)
|
||||||
return false;
|
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
|
//cannot hurt untargetable mobs
|
||||||
bodyType bt = target->GetBodyType();
|
bodyType bt = target->GetBodyType();
|
||||||
|
|
||||||
|
|||||||
@ -123,21 +123,12 @@ void NPC::SpellProcess()
|
|||||||
{
|
{
|
||||||
Mob::SpellProcess();
|
Mob::SpellProcess();
|
||||||
|
|
||||||
if(GetSwarmInfo()){
|
if (GetSwarmInfo()) {
|
||||||
Mob *swp_o = GetSwarmInfo()->GetOwner();
|
if (GetSwarmInfo()->duration->Check(false))
|
||||||
if(!swp_o)
|
|
||||||
{
|
|
||||||
Depop();
|
Depop();
|
||||||
}
|
|
||||||
|
|
||||||
if(GetSwarmInfo()->duration->Check(false))
|
|
||||||
{
|
|
||||||
Depop();
|
|
||||||
}
|
|
||||||
|
|
||||||
Mob *targMob = entity_list.GetMob(GetSwarmInfo()->target);
|
Mob *targMob = entity_list.GetMob(GetSwarmInfo()->target);
|
||||||
if(GetSwarmInfo()->target != 0)
|
if (GetSwarmInfo()->target != 0) {
|
||||||
{
|
|
||||||
if(!targMob || (targMob && targMob->IsCorpse()))
|
if(!targMob || (targMob && targMob->IsCorpse()))
|
||||||
Depop();
|
Depop();
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user