mirror of
https://github.com/mangosfour/server.git
synced 2025-12-15 19:37:02 +00:00
[8348] Use distance in getContactPoint used for charge spell effects.
Preventing victim from moving behind attacker when victim can move free. Signed-off-by: NoFantasy <nofantasy@nf.no>
This commit is contained in:
parent
b5c62ba9e5
commit
0d9fba971d
2 changed files with 6 additions and 3 deletions
|
|
@ -6070,8 +6070,11 @@ void Spell::EffectCharge(uint32 /*i*/)
|
|||
if (!unitTarget)
|
||||
return;
|
||||
|
||||
//TODO: research more ContactPoint/attack distance.
|
||||
//3.666666 instead of ATTACK_DISTANCE(5.0f) in below seem to give more accurate result.
|
||||
float x, y, z;
|
||||
unitTarget->GetContactPoint(m_caster, x, y, z);
|
||||
unitTarget->GetContactPoint(m_caster, x, y, z, 3.666666f);
|
||||
|
||||
if (unitTarget->GetTypeId() != TYPEID_PLAYER)
|
||||
((Creature *)unitTarget)->StopMoving();
|
||||
|
||||
|
|
@ -6099,7 +6102,7 @@ void Spell::EffectCharge2(uint32 /*i*/)
|
|||
((Creature *)unitTarget)->StopMoving();
|
||||
}
|
||||
else if (unitTarget && unitTarget != m_caster)
|
||||
unitTarget->GetContactPoint(m_caster, x, y, z);
|
||||
unitTarget->GetContactPoint(m_caster, x, y, z, 3.666666f);
|
||||
else
|
||||
return;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue