fixed that IntersectCharacter picks the character which is closest to the start point and within the radius

This commit is contained in:
oy 2010-12-12 01:55:36 +01:00
parent 369e22cd4e
commit b4c007778c

View file

@ -188,6 +188,7 @@ CCharacter *CGameWorld::IntersectCharacter(vec2 Pos0, vec2 Pos1, float Radius, v
float Len = distance(p->m_Pos, IntersectPos);
if(Len < p->m_ProximityRadius+Radius)
{
Len = distance(Pos0, IntersectPos);
if(Len < ClosestLen)
{
NewPos = IntersectPos;