1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-02-20 18:39:39 +00:00

Merge pull request #2597 from akortunov/coverity

CoverityScan fixes, part 2
This commit is contained in:
Bret Curtis 2019-11-14 21:08:03 +01:00 committed by GitHub
commit 454b9f1964
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 8 deletions

View file

@ -1439,8 +1439,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 {};

View file

@ -527,9 +527,7 @@ void Water::createSimpleWaterStateSet(osg::Node* node, float alpha)
// Add animated textures
std::vector<osg::ref_ptr<osg::Texture2D> > textures;
int frameCount = Fallback::Map::getInt("Water_SurfaceFrameCount");
frameCount = std::min(std::max(frameCount, 0), 320);
int frameCount = std::max(0, std::min(Fallback::Map::getInt("Water_SurfaceFrameCount"), 320));
const std::string& texture = Fallback::Map::getString("Water_SurfaceTexture");
for (int i=0; i<frameCount; ++i)
{
@ -645,9 +643,7 @@ Water::~Water()
void Water::listAssetsToPreload(std::vector<std::string> &textures)
{
int frameCount = Fallback::Map::getInt("Water_SurfaceFrameCount");
frameCount = std::min(std::max(frameCount, 0), 320);
int frameCount = std::max(0, std::min(Fallback::Map::getInt("Water_SurfaceFrameCount"), 320));
const std::string& texture = Fallback::Map::getString("Water_SurfaceTexture");
for (int i=0; i<frameCount; ++i)
{