1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-02-21 11:09:43 +00:00

Avoid zero division

This commit is contained in:
Andrei Kortunov 2019-11-13 14:57:22 +04:00
parent ca2a524a5f
commit 079c77ff22

View file

@ -730,8 +730,12 @@ void CSVRender::TerrainTextureMode::setBrushShape(int brushShape)
selectionCenterY += value.second;
++selectionAmount;
}
selectionCenterX /= selectionAmount;
selectionCenterY /= selectionAmount;
if (selectionAmount != 0)
{
selectionCenterX /= selectionAmount;
selectionCenterY /= selectionAmount;
}
mCustomBrushShape.clear();
for (auto const& value: terrainSelection)