mirror of
https://github.com/TES3MP/TES3MP.git
synced 2025-09-28 07:32:00 -04:00
Avoid zero division
This commit is contained in:
parent
ca2a524a5f
commit
079c77ff22
@ -730,8 +730,12 @@ void CSVRender::TerrainTextureMode::setBrushShape(int brushShape)
|
|||||||
selectionCenterY += value.second;
|
selectionCenterY += value.second;
|
||||||
++selectionAmount;
|
++selectionAmount;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (selectionAmount != 0)
|
||||||
|
{
|
||||||
selectionCenterX /= selectionAmount;
|
selectionCenterX /= selectionAmount;
|
||||||
selectionCenterY /= selectionAmount;
|
selectionCenterY /= selectionAmount;
|
||||||
|
}
|
||||||
|
|
||||||
mCustomBrushShape.clear();
|
mCustomBrushShape.clear();
|
||||||
for (auto const& value: terrainSelection)
|
for (auto const& value: terrainSelection)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user