mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 16:37:01 +00:00
Fix/prevent cast if client send incorrect target for some spells
Signed-off-by: DiSlord <dislord@nomail.com>
This commit is contained in:
parent
9f08095c26
commit
7e6f7bf6e4
1 changed files with 14 additions and 0 deletions
|
|
@ -3639,6 +3639,20 @@ uint8 Spell::CanCast(bool strict)
|
|||
}
|
||||
}
|
||||
}
|
||||
else if (m_caster->GetTypeId()==TYPEID_PLAYER) // Target - is player caster
|
||||
{
|
||||
// Additional check for some spells
|
||||
// If 0 spell effect empty - client not send target data (need use selection)
|
||||
// TODO: check it on next client version
|
||||
if (m_targets.m_targetMask == TARGET_FLAG_SELF &&
|
||||
m_spellInfo->Effect[0] == 0 && m_spellInfo->EffectImplicitTargetA[1] != TARGET_SELF)
|
||||
{
|
||||
if (target = m_caster->GetUnit(*m_caster, ((Player *)m_caster)->GetSelection()))
|
||||
m_targets.setUnitTarget(target);
|
||||
else
|
||||
return SPELL_FAILED_BAD_TARGETS;
|
||||
}
|
||||
}
|
||||
|
||||
// check pet presents
|
||||
for(int j=0;j<3;j++)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue