averisimilitude
Wanderer
Fixing Range
Hello,
Well, here is the change I made to Utility.cs, since Geometry.cs already has Point3D defined, yet Utility.cs was not using it as defined:
I just added the Z component they already defined, so now you won't get someone on the third floor shooting or stealing from someone on the ground just because their X,Y is under range... now all three have to be.
A.V.
Hello,
Well, here is the change I made to Utility.cs, since Geometry.cs already has Point3D defined, yet Utility.cs was not using it as defined:
Code:
public static bool InRange( Point3D p1, Point3D p2, int range )
{
return ( p1.m_X >= (p2.m_X - range) )
&& ( p1.m_X <= (p2.m_X + range) )
&& ( p1.m_Y >= (p2.m_Y - range) )
&& ( p1.m_Y <= (p2.m_Y + range) )
&& ( p1.m_Z >= (p2.m_Z - range) )
&& ( p1.m_Z <= (p2.m_Z + range) );
}
public static bool InUpdateRange( Point3D p1, Point3D p2 )
{
return ( p1.m_X >= (p2.m_X - 18) )
&& ( p1.m_X <= (p2.m_X + 18) )
&& ( p1.m_Y >= (p2.m_Y - 18) )
&& ( p1.m_Y <= (p2.m_Y + 18) )
&& ( p1.m_Z >= (p2.m_Z - 18) )
&& ( p1.m_Z <= (p2.m_Z + 18) );
I just added the Z component they already defined, so now you won't get someone on the third floor shooting or stealing from someone on the ground just because their X,Y is under range... now all three have to be.
A.V.