mirror of
https://git.do.srb2.org/STJr/UltimateZoneBuilder.git
synced 2025-02-07 08:21:59 +00:00
Fixed a bug in the SidedefAngleSorter which caused a crash when analyzing on some maps
This commit is contained in:
parent
bcbe994280
commit
d22aba4398
1 changed files with 6 additions and 8 deletions
|
@ -78,18 +78,16 @@ namespace CodeImp.DoomBuilder.Geometry
|
||||||
// Comparer
|
// Comparer
|
||||||
public int Compare(Sidedef x, Sidedef y)
|
public int Compare(Sidedef x, Sidedef y)
|
||||||
{
|
{
|
||||||
float ax, ay;
|
// Somehow, in a release build without debugger attached,
|
||||||
|
// the code above is not always the same when x == y... don't ask.
|
||||||
|
if(x == y)
|
||||||
|
return 0;
|
||||||
|
|
||||||
// Calculate angles
|
// Calculate angles
|
||||||
ax = CalculateRelativeAngle(baseside, x);
|
float ax = CalculateRelativeAngle(baseside, x);
|
||||||
ay = CalculateRelativeAngle(baseside, y);
|
float ay = CalculateRelativeAngle(baseside, y);
|
||||||
|
|
||||||
// Compare results
|
// Compare results
|
||||||
/*
|
|
||||||
if(ax < ay) return 1;
|
|
||||||
else if(ax > ay) return -1;
|
|
||||||
else return 0;
|
|
||||||
*/
|
|
||||||
return Math.Sign(ay - ax);
|
return Math.Sign(ay - ax);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue