fix: only dismiss pet summoned by the fading familiar buff

When a Familiar buff fades, BuffFadeBySlot called GetPet() and depopulated
whatever pet the player currently had — regardless of whether that pet was
the familiar or a combat pet summoned later.

Add a spell ID check: only dismiss the pet if its PetSpellID matches the
buff's spell ID. If the player replaced the familiar with a different pet,
the new pet is unaffected when the old familiar buff expires.

Fixes #5026
This commit is contained in:
Roy Love 2026-04-10 21:00:39 -05:00
parent ba2ca5eada
commit d413ea4243

View File

@ -4394,9 +4394,9 @@ void Mob::BuffFadeBySlot(int slot, bool iRecalcBonuses)
case SpellEffect::Familiar:
{
Mob *mypet = GetPet();
if (mypet){
if(mypet->IsNPC())
mypet->CastToNPC()->Depop();
if (mypet && mypet->IsNPC() &&
mypet->CastToNPC()->GetPetSpellID() == buffs[slot].spellid) {
mypet->CastToNPC()->Depop();
SetPetID(0);
}
break;