From 0d9fba971d59a6eff1ab90cb36050d4facc03d6f Mon Sep 17 00:00:00 2001 From: NoFantasy Date: Tue, 11 Aug 2009 01:30:07 +0200 Subject: [PATCH] [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 --- src/game/SpellEffects.cpp | 7 +++++-- src/shared/revision_nr.h | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp index e61f24182..32bc97002 100644 --- a/src/game/SpellEffects.cpp +++ b/src/game/SpellEffects.cpp @@ -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; diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index fac0ad27e..9ec1fa785 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "8347" + #define REVISION_NR "8348" #endif // __REVISION_NR_H__