mirror of
https://git.do.srb2.org/STJr/UltimateZoneBuilder.git
synced 2025-01-31 04:40:55 +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
|
||||
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
|
||||
ax = CalculateRelativeAngle(baseside, x);
|
||||
ay = CalculateRelativeAngle(baseside, y);
|
||||
float ax = CalculateRelativeAngle(baseside, x);
|
||||
float ay = CalculateRelativeAngle(baseside, y);
|
||||
|
||||
// Compare results
|
||||
/*
|
||||
if(ax < ay) return 1;
|
||||
else if(ax > ay) return -1;
|
||||
else return 0;
|
||||
*/
|
||||
return Math.Sign(ay - ax);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue