mirror of
https://github.com/mangosfour/server.git
synced 2025-12-16 22: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)
|
if (!unitTarget)
|
||||||
return;
|
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;
|
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)
|
if (unitTarget->GetTypeId() != TYPEID_PLAYER)
|
||||||
((Creature *)unitTarget)->StopMoving();
|
((Creature *)unitTarget)->StopMoving();
|
||||||
|
|
||||||
|
|
@ -6099,7 +6102,7 @@ void Spell::EffectCharge2(uint32 /*i*/)
|
||||||
((Creature *)unitTarget)->StopMoving();
|
((Creature *)unitTarget)->StopMoving();
|
||||||
}
|
}
|
||||||
else if (unitTarget && unitTarget != m_caster)
|
else if (unitTarget && unitTarget != m_caster)
|
||||||
unitTarget->GetContactPoint(m_caster, x, y, z);
|
unitTarget->GetContactPoint(m_caster, x, y, z, 3.666666f);
|
||||||
else
|
else
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "8347"
|
#define REVISION_NR "8348"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue