Skip to content

Commit

Permalink
Skip not selectable unit check for TARGET_LOCATION_SCRIPT_NEAR_CASTER.
Browse files Browse the repository at this point in the history
  • Loading branch information
ratkosrb committed Nov 4, 2023
1 parent 017c262 commit 36a386f
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions src/game/Spells/Spell.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8190,18 +8190,20 @@ bool Spell::CheckTarget(Unit* target, SpellEffectIndex eff)
if (target->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_SPAWNING))
return false;

// unselectable targets skipped in all cases except TARGET_UNIT_SCRIPT_NEAR_CASTER targeting
// in case TARGET_UNIT_SCRIPT_NEAR_CASTER target selected by server always and can't be cheated
// unselectable targets skipped in all cases except db defined script targets
// in that case the target is selected by server, not by client, so no cheating
if ((!m_IsTriggeredSpell || target != m_targets.getUnitTarget()) &&
target->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE) &&
m_spellInfo->EffectImplicitTargetA[eff] != TARGET_UNIT_SCRIPT_NEAR_CASTER &&
m_spellInfo->EffectImplicitTargetB[eff] != TARGET_UNIT_SCRIPT_NEAR_CASTER &&
m_spellInfo->EffectImplicitTargetA[eff] != TARGET_ENUM_UNITS_SCRIPT_AOE_AT_SRC_LOC &&
m_spellInfo->EffectImplicitTargetB[eff] != TARGET_ENUM_UNITS_SCRIPT_AOE_AT_SRC_LOC &&
m_spellInfo->EffectImplicitTargetA[eff] != TARGET_ENUM_UNITS_SCRIPT_AOE_AT_DEST_LOC &&
m_spellInfo->EffectImplicitTargetB[eff] != TARGET_ENUM_UNITS_SCRIPT_AOE_AT_DEST_LOC &&
m_spellInfo->EffectImplicitTargetA[eff] != TARGET_ENUM_UNITS_SCRIPT_IN_CONE_60 &&
m_spellInfo->EffectImplicitTargetB[eff] != TARGET_ENUM_UNITS_SCRIPT_IN_CONE_60)
target->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE) &&
m_spellInfo->EffectImplicitTargetA[eff] != TARGET_UNIT_SCRIPT_NEAR_CASTER &&
m_spellInfo->EffectImplicitTargetB[eff] != TARGET_UNIT_SCRIPT_NEAR_CASTER &&
m_spellInfo->EffectImplicitTargetA[eff] != TARGET_ENUM_UNITS_SCRIPT_AOE_AT_SRC_LOC &&
m_spellInfo->EffectImplicitTargetB[eff] != TARGET_ENUM_UNITS_SCRIPT_AOE_AT_SRC_LOC &&
m_spellInfo->EffectImplicitTargetA[eff] != TARGET_ENUM_UNITS_SCRIPT_AOE_AT_DEST_LOC &&
m_spellInfo->EffectImplicitTargetB[eff] != TARGET_ENUM_UNITS_SCRIPT_AOE_AT_DEST_LOC &&
m_spellInfo->EffectImplicitTargetA[eff] != TARGET_ENUM_UNITS_SCRIPT_IN_CONE_60 &&
m_spellInfo->EffectImplicitTargetB[eff] != TARGET_ENUM_UNITS_SCRIPT_IN_CONE_60 &&
m_spellInfo->EffectImplicitTargetA[eff] != TARGET_LOCATION_SCRIPT_NEAR_CASTER &&
m_spellInfo->EffectImplicitTargetB[eff] != TARGET_LOCATION_SCRIPT_NEAR_CASTER)
return false;
}

Expand Down

0 comments on commit 36a386f

Please sign in to comment.