From f6ea22647dc42a2e29d05219ffa89b59ed748da6 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sun, 10 Nov 2019 00:47:40 +0000 Subject: [PATCH] terraforming changes: make jenkis happy --- .../CoreModules/World/Terrain/FloodBrushes/LowerArea.cs | 8 ++++---- .../CoreModules/World/Terrain/PaintBrushes/LowerSphere.cs | 4 ++-- .../CoreModules/World/Terrain/PaintBrushes/RaiseSphere.cs | 6 +++--- .../Region/CoreModules/World/Terrain/Tests/TerrainTest.cs | 6 +++--- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/OpenSim/Region/CoreModules/World/Terrain/FloodBrushes/LowerArea.cs b/OpenSim/Region/CoreModules/World/Terrain/FloodBrushes/LowerArea.cs index 80209623cb..ecf7dfbf84 100644 --- a/OpenSim/Region/CoreModules/World/Terrain/FloodBrushes/LowerArea.cs +++ b/OpenSim/Region/CoreModules/World/Terrain/FloodBrushes/LowerArea.cs @@ -37,15 +37,15 @@ namespace OpenSim.Region.CoreModules.World.Terrain.FloodBrushes int startX, int endX, int startY, int endY) { int x,y; - for (x = startX; x <= endX; x++) + for (x = startX; x <= endX; ++x) { - for (y = startY; y <= endY; y++) + for (y = startY; y <= endY; ++y) { if (fillArea[x, y]) { map[x, y] -= strength; - if (map[x, y] < -100f) - map[x, y] = -100f; + if (map[x, y] < 0f) + map[x, y] = 0f; } } } diff --git a/OpenSim/Region/CoreModules/World/Terrain/PaintBrushes/LowerSphere.cs b/OpenSim/Region/CoreModules/World/Terrain/PaintBrushes/LowerSphere.cs index 68c6151588..5a31a603ee 100644 --- a/OpenSim/Region/CoreModules/World/Terrain/PaintBrushes/LowerSphere.cs +++ b/OpenSim/Region/CoreModules/World/Terrain/PaintBrushes/LowerSphere.cs @@ -54,8 +54,8 @@ namespace OpenSim.Region.CoreModules.World.Terrain.PaintBrushes if (distancefactor > 0.0) { double newz = map[x, y] - distancefactor * strength; - if (newz <= -100f) - map[x, y] = -100f; + if (newz <= 0f) + map[x, y] = 0f; else map[x, y] = newz; } diff --git a/OpenSim/Region/CoreModules/World/Terrain/PaintBrushes/RaiseSphere.cs b/OpenSim/Region/CoreModules/World/Terrain/PaintBrushes/RaiseSphere.cs index 2155368034..e2773636d8 100644 --- a/OpenSim/Region/CoreModules/World/Terrain/PaintBrushes/RaiseSphere.cs +++ b/OpenSim/Region/CoreModules/World/Terrain/PaintBrushes/RaiseSphere.cs @@ -43,14 +43,14 @@ namespace OpenSim.Region.CoreModules.World.Terrain.PaintBrushes int x, y; - for (x = startX; x <= endX; x++) + for (x = startX; x <= endX; ++x) { - for (y = startY; y <= endY; y++) + for (y = startY; y <= endY; ++y) { if (!mask[x, y]) continue; - // Calculate a cos-sphere and add it to the heighmap + // Calculate a cos-sphere and add it to the heighmap double r = Math.Sqrt((x - rx) * (x - rx) + (y - ry) * (y - ry)); double distancefactor = Math.Cos(r * size); if (distancefactor > 0.0) diff --git a/OpenSim/Region/CoreModules/World/Terrain/Tests/TerrainTest.cs b/OpenSim/Region/CoreModules/World/Terrain/Tests/TerrainTest.cs index 3edef3a9b0..b39e0a2373 100644 --- a/OpenSim/Region/CoreModules/World/Terrain/Tests/TerrainTest.cs +++ b/OpenSim/Region/CoreModules/World/Terrain/Tests/TerrainTest.cs @@ -60,10 +60,10 @@ namespace OpenSim.Region.CoreModules.World.Terrain.Tests TerrainChannel map = new TerrainChannel((int)Constants.RegionSize, (int)Constants.RegionSize); ITerrainPaintableEffect effect = new RaiseSphere(); - effect.PaintEffect(map, allowMask, midRegion, midRegion, -1.0f, 2, 6.0f, + effect.PaintEffect(map, allowMask, midRegion, midRegion, -1.0f, 5, 6.0f, 0, midRegion - 1,0, (int)Constants.RegionSize -1); Assert.That(map[127, midRegion] > 0.0, "Raise brush should raising value at this point (127,128)."); - Assert.That(map[125, midRegion] > 0.0, "Raise brush should raising value at this point (124,128)."); + Assert.That(map[124, midRegion] > 0.0, "Raise brush should raising value at this point (124,128)."); Assert.That(map[120, midRegion] == 0.0, "Raise brush should not change value at this point (120,128)."); Assert.That(map[128, midRegion] == 0.0, "Raise brush should not change value at this point (128,128)."); // Assert.That(map[0, midRegion] == 0.0, "Raise brush should not change value at this point (0,128)."); @@ -80,7 +80,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain.Tests } effect = new LowerSphere(); - effect.PaintEffect(map, allowMask, midRegion, midRegion, -1.0f, 2, 6.0f, + effect.PaintEffect(map, allowMask, midRegion, midRegion, -1.0f, 5, 6.0f, 0, (int)Constants.RegionSize -1,0, (int)Constants.RegionSize -1); Assert.That(map[127, midRegion] >= 0.0, "Lower should not lowering value below 0.0 at this point (127,128)."); Assert.That(map[127, midRegion] == 0.0, "Lower brush should lowering value to 0.0 at this point (127,128).");