Point3D Comparison CrashBug-Fix
I already posted this in the Bugtracker, but since no one seems to care since about a month i'm posting it here again to prevent some of you from a Servercrash.
The problem is located in Point3D.operator ==(Point3D, IPoint3D) and Point3D.operator !=(Point3D, IPoint3D). It is never checked if the IPoint3D is null (to be honest - it seems to me that method is just copied from the comparison Point3D-Point3D, which can't be null, since it is a value type).
The fix for that is pretty simple - just a check if the IPoint3D-value is null:
I already posted this in the Bugtracker, but since no one seems to care since about a month i'm posting it here again to prevent some of you from a Servercrash.
The problem is located in Point3D.operator ==(Point3D, IPoint3D) and Point3D.operator !=(Point3D, IPoint3D). It is never checked if the IPoint3D is null (to be honest - it seems to me that method is just copied from the comparison Point3D-Point3D, which can't be null, since it is a value type).
The fix for that is pretty simple - just a check if the IPoint3D-value is null:
Code:
public static bool operator == ( Point3D l, IPoint3D r )
{
if (r == null) return false;
return l.m_X == r.X && l.m_Y == r.Y && l.m_Z == r.Z;
}
public static bool operator != ( Point3D l, IPoint3D r )
{
if (r == null) return false;
return l.m_X != r.X || l.m_Y != r.Y || l.m_Z != r.Z;
}