[Bug Fix] Summon Companion causing pets to warps away. (#1972)

* Update spell_effects.cpp

* Update spell_effects.cpp
This commit is contained in:
KayenEQ 2022-02-08 07:36:04 -05:00 committed by GitHub
parent 8a48473dbc
commit 872d494bb6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2163,9 +2163,12 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove
snprintf(effect_desc, _EDLEN, "Call Pet");
#endif
// this is cast on self, not on the pet
if(GetPet() && GetPet()->IsNPC())
{
GetPet()->CastToNPC()->GMMove(GetX(), GetY(), GetZ(), GetHeading());
Mob *casters_pet = GetPet();
if(casters_pet && casters_pet->IsNPC()){
casters_pet->CastToNPC()->GMMove(GetX(), GetY(), GetZ(), GetHeading());
if (!casters_pet->GetTarget()) {
casters_pet->StopNavigation();
}
}
break;
}