Attempt to fix ThrowOrIgnoreBadComparer exception in LightSource.FindRaycastHits.
Couldn't reproduce the crash, but I'm guessing it could be caused by CompareCCW not returning 0 if comparing a position to itself. (and if not, at least the exception is caught now)
This commit is contained in:
@@ -512,6 +512,7 @@ namespace Barotrauma
|
||||
|
||||
public static int Compare(Vector2 a, Vector2 b, Vector2 center)
|
||||
{
|
||||
if (a == b) return 0;
|
||||
if (a.X - center.X >= 0 && b.X - center.X < 0) return -1;
|
||||
if (a.X - center.X < 0 && b.X - center.X >= 0) return 1;
|
||||
if (a.X - center.X == 0 && b.X - center.X == 0)
|
||||
|
||||
Reference in New Issue
Block a user