- Fixed: Undefined negative double to unsigned int conversion in FNodeBuilder::PointToAngle.

This commit is contained in:
Braden Obrzut 2016-01-18 16:03:37 -05:00
parent b63eb391f7
commit d94aaf1fcf

View file

@ -76,7 +76,8 @@ angle_t FNodeBuilder::PointToAngle (fixed_t x, fixed_t y)
#else // !__APPLE__ || __llvm__
double ang = atan2 (double(y), double(x));
#endif // __APPLE__ && !__llvm__
return angle_t(ang * rad2bam) << 1;
// Convert to signed first since negative double to unsigned is undefined.
return angle_t(int(ang * rad2bam)) << 1;
}
void FNodeBuilder::FindUsedVertices (vertex_t *oldverts, int max)