mirror of
https://github.com/OpenMW/openmw.git
synced 2025-02-22 10:09:41 +00:00
Avoid divizion by zero
This commit is contained in:
parent
3970baeb84
commit
b210e99abc
1 changed files with 6 additions and 2 deletions
|
@ -1418,8 +1418,12 @@ void CSVRender::TerrainShapeMode::setBrushShape(CSVWidget::BrushShape brushShape
|
||||||
selectionCenterY = selectionCenterY + value.second;
|
selectionCenterY = selectionCenterY + value.second;
|
||||||
++selectionAmount;
|
++selectionAmount;
|
||||||
}
|
}
|
||||||
selectionCenterX = selectionCenterX / selectionAmount;
|
|
||||||
selectionCenterY = selectionCenterY / selectionAmount;
|
if (selectionAmount != 0)
|
||||||
|
{
|
||||||
|
selectionCenterX /= selectionAmount;
|
||||||
|
selectionCenterY /= selectionAmount;
|
||||||
|
}
|
||||||
|
|
||||||
mCustomBrushShape.clear();
|
mCustomBrushShape.clear();
|
||||||
std::pair<int, int> differentialPos {};
|
std::pair<int, int> differentialPos {};
|
||||||
|
|
Loading…
Reference in a new issue