mirror of
https://github.com/OpenMW/openmw.git
synced 2025-02-21 13:09:42 +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;
|
||||
++selectionAmount;
|
||||
}
|
||||
selectionCenterX = selectionCenterX / selectionAmount;
|
||||
selectionCenterY = selectionCenterY / selectionAmount;
|
||||
|
||||
if (selectionAmount != 0)
|
||||
{
|
||||
selectionCenterX /= selectionAmount;
|
||||
selectionCenterY /= selectionAmount;
|
||||
}
|
||||
|
||||
mCustomBrushShape.clear();
|
||||
std::pair<int, int> differentialPos {};
|
||||
|
|
Loading…
Reference in a new issue