[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:
NoFantasy 2009-08-11 01:30:07 +02:00
parent b5c62ba9e5
commit 0d9fba971d
2 changed files with 6 additions and 3 deletions

View file

@ -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;

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "8347"
#define REVISION_NR "8348"
#endif // __REVISION_NR_H__