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:
Regalis
2017-04-05 21:36:31 +03:00
parent b3bbdbf589
commit 7cb88e39e9
2 changed files with 14 additions and 1 deletions
+1
View File
@@ -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)