mirror of
https://github.com/EQEmu/Server.git
synced 2026-06-22 03:18:22 +00:00
Fix DetermineSpellTargets for group spells (this also wasn't properly checking the rule Character:EnableTGB in master)
This commit is contained in:
+10
-9
@@ -2169,21 +2169,22 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce
|
|||||||
case ST_Group:
|
case ST_Group:
|
||||||
case ST_GroupNoPets:
|
case ST_GroupNoPets:
|
||||||
{
|
{
|
||||||
spell_target = this; // Default to self
|
bool tgb_enabled = (IsClient() && RuleB(Character, EnableTGB) && CastToClient()->TGB()) ||
|
||||||
|
(IsBot() && RuleB(Bots, EnableBotTGB));
|
||||||
bool tgb_enabled = (IsClient() && CastToClient()->TGB()) ||
|
|
||||||
(IsBot() && RuleB(Bots, EnableBotTGB));
|
|
||||||
bool tgb_compatible = IsTGBCompatibleSpell(spell_id);
|
bool tgb_compatible = IsTGBCompatibleSpell(spell_id);
|
||||||
bool item_tgb_allowed = (slot != CastingSlot::Item || RuleB(Spells, AllowItemTGB));
|
bool item_tgb_allowed = (slot != CastingSlot::Item || RuleB(Spells, AllowItemTGB));
|
||||||
|
|
||||||
if (tgb_enabled && tgb_compatible && item_tgb_allowed) {
|
if (tgb_enabled && tgb_compatible && item_tgb_allowed) {
|
||||||
bool valid_target = target && !target->IsCorpse() &&
|
bool valid_target = spell_target &&
|
||||||
(!target->IsNPC() ||
|
!spell_target->IsCorpse() &&
|
||||||
(target->GetOwner() && target->GetOwner()->IsOfClientBot()));
|
(!spell_target->IsNPC() ||
|
||||||
|
(spell_target->GetOwner() && spell_target->IsPetOwnerOfClientBot()));
|
||||||
|
|
||||||
if (valid_target) {
|
if (!valid_target) {
|
||||||
spell_target = target;
|
spell_target = this;
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
spell_target = this;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (spell_target && spell_target->IsPet() && spells[spell_id].target_type == ST_GroupNoPets) {
|
if (spell_target && spell_target->IsPet() && spells[spell_id].target_type == ST_GroupNoPets) {
|
||||||
|
|||||||
Reference in New Issue
Block a user