mirror of
https://github.com/mangosfour/server.git
synced 2025-12-18 10:37:01 +00:00
Some fixes/add to prev commit
Signed-off-by: DiSlord <dislord@nomail.com>
This commit is contained in:
parent
abaa111eaa
commit
4b5aba18f8
1 changed files with 18 additions and 10 deletions
|
|
@ -2044,15 +2044,17 @@ void Spell::prepare(SpellCastTargets const* targets, Aura* triggeredByAura)
|
||||||
|
|
||||||
m_spellState = SPELL_STATE_PREPARING;
|
m_spellState = SPELL_STATE_PREPARING;
|
||||||
|
|
||||||
|
if (!(m_targets.m_targetMask & TARGET_FLAG_SOURCE_LOCATION))
|
||||||
|
{
|
||||||
// Check original caster is GO - set its coordinates as src cast
|
// Check original caster is GO - set its coordinates as src cast
|
||||||
WorldObject *caster = NULL;
|
WorldObject *caster = NULL;
|
||||||
if (m_originalCasterGUID)
|
if (m_originalCasterGUID)
|
||||||
caster = (WorldObject *)ObjectAccessor::GetObjectByTypeMask(*m_caster, m_originalCasterGUID, TYPEMASK_GAMEOBJECT);
|
caster = ObjectAccessor::GetGameObject(*m_caster, m_originalCasterGUID);
|
||||||
if (!caster)
|
if (!caster)
|
||||||
caster = m_caster;
|
caster = m_caster;
|
||||||
|
|
||||||
// Set cast source for targets
|
// Set cast source for targets
|
||||||
m_targets.setSource(caster->GetPositionX(), caster->GetPositionY(), caster->GetPositionZ());
|
m_targets.setSource(caster->GetPositionX(), caster->GetPositionY(), caster->GetPositionZ());
|
||||||
|
}
|
||||||
|
|
||||||
m_castPositionX = m_caster->GetPositionX();
|
m_castPositionX = m_caster->GetPositionX();
|
||||||
m_castPositionY = m_caster->GetPositionY();
|
m_castPositionY = m_caster->GetPositionY();
|
||||||
|
|
@ -5420,7 +5422,13 @@ bool Spell::CheckTarget( Unit* target, uint32 eff )
|
||||||
// all ok by some way or another, skip normal check
|
// all ok by some way or another, skip normal check
|
||||||
break;
|
break;
|
||||||
default: // normal case
|
default: // normal case
|
||||||
if(target!=m_caster && !target->IsWithinLOSInMap(m_caster))
|
// Get GO cast coordinates if original caster -> GO
|
||||||
|
WorldObject *caster = NULL;
|
||||||
|
if (m_originalCasterGUID)
|
||||||
|
caster = ObjectAccessor::GetGameObject(*m_caster, m_originalCasterGUID);
|
||||||
|
if (!caster)
|
||||||
|
caster = m_caster;
|
||||||
|
if(target!=m_caster && !target->IsWithinLOSInMap(caster))
|
||||||
return false;
|
return false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue