From 24b396e516410f107bea2dc3309d3f86ab8a4da2 Mon Sep 17 00:00:00 2001 From: "Michael Cook (mackal)" Date: Tue, 6 Feb 2018 21:50:59 -0500 Subject: [PATCH] Fix /pet leader --- zone/client_packet.cpp | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/zone/client_packet.cpp b/zone/client_packet.cpp index 53fa8a27d..42a78cdaa 100644 --- a/zone/client_packet.cpp +++ b/zone/client_packet.cpp @@ -9960,22 +9960,18 @@ void Client::Handle_OP_PetCommands(const EQApplicationPacket *app) Mob* mypet = this->GetPet(); Mob *target = entity_list.GetMob(pet->target); - if (!mypet || pet->command == PET_LEADER) - { - if (pet->command == PET_LEADER) - { - if (mypet && (!GetTarget() || GetTarget() == mypet)) - { + if (!mypet || pet->command == PET_LEADER) { + if (pet->command == PET_LEADER) { + // we either send the ID of an NPC we're interested in or no ID for our own pet + if (target) { + auto owner = target->GetOwner(); + if (owner) + target->Say_StringID(PET_LEADERIS, owner->GetCleanName()); + else + target->Say_StringID(I_FOLLOW_NOONE); + } else if (mypet) { mypet->Say_StringID(PET_LEADERIS, GetName()); } - else if ((mypet = GetTarget())) - { - Mob *Owner = mypet->GetOwner(); - if (Owner) - mypet->Say_StringID(PET_LEADERIS, Owner->GetCleanName()); - else if (mypet->IsNPC()) - mypet->Say_StringID(I_FOLLOW_NOONE); - } } return;