From b2d500746633ec6c5a77cbd05b38c97ae3edda84 Mon Sep 17 00:00:00 2001 From: Fryguy Date: Mon, 8 Jan 2024 02:27:45 -0500 Subject: [PATCH] [Bug Fix] TGB - Added logic to stop bard errors on group songs. (#3906) * [Bug Fix] TGB - Added logic to stop bard errors on group songs. Occasionally bards would get an error when singing songs with another group member targetted. * Logic Fix * Fixed missing brace --- zone/spells.cpp | 55 +++++++++++++++++++++++++------------------------ 1 file changed, 28 insertions(+), 27 deletions(-) diff --git a/zone/spells.cpp b/zone/spells.cpp index b23a1a911..1a6d4d875 100644 --- a/zone/spells.cpp +++ b/zone/spells.cpp @@ -2619,74 +2619,75 @@ bool Mob::SpellFinished(uint16 spell_id, Mob *spell_target, CastingSlot slot, in case GroupSpell: { - if(IsBot()) { - bool StopLogic = false; - if(!CastToBot()->DoFinishedSpellGroupTarget(spell_id, spell_target, slot, StopLogic)) + if (IsBot()) { + bool stop_logic = false; + if (!CastToBot()->DoFinishedSpellGroupTarget(spell_id, spell_target, slot, stop_logic)) { return false; - if(StopLogic) + } + + if(stop_logic) { break; + } } // We hold off turning MBG off so we can still use it to calc the mana cost - if(spells[spell_id].can_mgb && HasMGB()) - { + if (spells[spell_id].can_mgb && HasMGB()) { SpellOnTarget(spell_id, this); entity_list.MassGroupBuff(this, this, spell_id, true); - } - else - { + } else { // at this point spell_target is a member of the other group, or the // caster if they're not using TGB // NOTE: this will always hit the caster, plus the target's group so // it can affect up to 7 people if the targeted group is not our own // Allow pets who cast group spells to affect the group. - if (spell_target->IsPetOwnerClient() && IsPetOwnerClient()){ + if (spell_target->IsPetOwnerClient() && IsPetOwnerClient()) { Mob* owner = spell_target->GetOwner(); - if (owner) + if (owner) { spell_target = owner; + } } - if(spell_target->IsGrouped()) - { + if (spell_target->IsGrouped()) { Group *target_group = entity_list.GetGroupByMob(spell_target); - if(target_group) - { + if (target_group) { target_group->CastGroupSpell(this, spell_id); + if (GetClass() != Class::Bard) { + SpellOnTarget(spell_id, this); + } } - } - else if(spell_target->IsRaidGrouped() && spell_target->IsClient()) - { + } else if (spell_target->IsRaidGrouped() && spell_target->IsClient()) { Raid *target_raid = entity_list.GetRaidByClient(spell_target->CastToClient()); uint32 gid = 0xFFFFFFFF; - if(target_raid){ + if (target_raid) { gid = target_raid->GetGroup(spell_target->GetName()); - if(gid < 12) + if (gid < 12) { target_raid->CastGroupSpell(this, spell_id, gid); - else + } else { SpellOnTarget(spell_id, spell_target); + } } - } - else - { + } else { // if target is grouped, CastGroupSpell will cast it on the caster // too, but if not then we have to do that here. - if(spell_target != this){ + if (spell_target != this) { SpellOnTarget(spell_id, this); #ifdef GROUP_BUFF_PETS //pet too - if (spells[spell_id].target_type != ST_GroupNoPets && GetPet() && HasPetAffinity() && !GetPet()->IsCharmed()) + if (spells[spell_id].target_type != ST_GroupNoPets && GetPet() && HasPetAffinity() && !GetPet()->IsCharmed()) { SpellOnTarget(spell_id, GetPet()); + } #endif } SpellOnTarget(spell_id, spell_target); #ifdef GROUP_BUFF_PETS //pet too - if (spells[spell_id].target_type != ST_GroupNoPets && spell_target->GetPet() && spell_target->HasPetAffinity() && !spell_target->GetPet()->IsCharmed()) + if (spells[spell_id].target_type != ST_GroupNoPets && spell_target->GetPet() && spell_target->HasPetAffinity() && !spell_target->GetPet()->IsCharmed()) { SpellOnTarget(spell_id, spell_target->GetPet()); + } #endif } }