From 9c08d6f25b1d0a2b290eda307c14abd5672fd43c Mon Sep 17 00:00:00 2001 From: E Spause Date: Wed, 15 Mar 2017 07:09:14 -0400 Subject: [PATCH] Fix additional logic cases for merc disbanding. --- zone/client_packet.cpp | 54 +++++++++++++++++++++++++++++++++++++----- 1 file changed, 48 insertions(+), 6 deletions(-) diff --git a/zone/client_packet.cpp b/zone/client_packet.cpp index 858ff55e0..97408a8e3 100644 --- a/zone/client_packet.cpp +++ b/zone/client_packet.cpp @@ -6549,9 +6549,30 @@ void Client::Handle_OP_GroupDisband(const EQApplicationPacket *app) if (group->GroupCount() < 3) { - group->DisbandGroup(); - if (GetMerc()) - GetMerc()->Suspend(); + if (!RuleB(Mercs, AllowMercSuspendInCombat)) { + if (GetMerc()) + { + Mob* mercOwner = GetMerc()->GetOwner(); + if (mercOwner && mercOwner->IsClient()) { + if (mercOwner->CastToClient()->CheckCanSpawnMerc(mercOwner->CastToClient()->GetMercInfo().MercTemplateID)) { + group->DisbandGroup(); + GetMerc()->Suspend(); + } + } + } + else + { + group->DisbandGroup(); + if (GetMerc()) + GetMerc()->Suspend(); + } + } + else + { + group->DisbandGroup(); + if (GetMerc()) + GetMerc()->Suspend(); + } } else if (group->IsLeader(this) && GetTarget() == nullptr) { @@ -6562,9 +6583,30 @@ void Client::Handle_OP_GroupDisband(const EQApplicationPacket *app) } else { - group->DisbandGroup(); - if (GetMerc()) - GetMerc()->Suspend(); + if (!RuleB(Mercs, AllowMercSuspendInCombat)) { + if (GetMerc()) + { + Mob* mercOwner = GetMerc()->GetOwner(); + if (mercOwner && mercOwner->IsClient()) { + if (mercOwner->CastToClient()->CheckCanSpawnMerc(mercOwner->CastToClient()->GetMercInfo().MercTemplateID)) { + group->DisbandGroup(); + GetMerc()->Suspend(); + } + } + } + else + { + group->DisbandGroup(); + if (GetMerc()) + GetMerc()->Suspend(); + } + + } + else { + group->DisbandGroup(); + if (GetMerc()) + GetMerc()->Suspend(); + } } } else if (group->IsLeader(this) && (GetTarget() == this || memberToDisband == this))