1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-03-30 00:36:39 +00:00

Fix coverity warning

CID 332936 (#1 of 1): Result is not floating-point (UNINTENDED_INTEGER_DIVISION)
integer_division: Dividing integer expressions size and 2, and then converting
the integer quotient to type float. Any remainder, or fractional part of the
quotient, is ignored.
This commit is contained in:
elsid 2021-08-25 18:34:42 +02:00
parent 7cc58fa20d
commit ee63ee9d93
No known key found for this signature in database
GPG key ID: B845CB9FEE18AB40

View file

@ -36,7 +36,7 @@ namespace DetourNavigator
TileBounds maxCellTileBounds(int size, const osg::Vec3f& shift)
{
const float halfCellSize = size / 2;
const float halfCellSize = static_cast<float>(size) / 2;
return TileBounds {
osg::Vec2f(shift.x() - halfCellSize, shift.y() - halfCellSize),
osg::Vec2f(shift.x() + halfCellSize, shift.y() + halfCellSize)