diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Environment/Modules/World/Terrain/PaintBrushes/NoiseSphere.cs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/OpenSim/Region/Environment/Modules/World/Terrain/PaintBrushes/NoiseSphere.cs b/OpenSim/Region/Environment/Modules/World/Terrain/PaintBrushes/NoiseSphere.cs index 8ae583e..0824efd 100644 --- a/OpenSim/Region/Environment/Modules/World/Terrain/PaintBrushes/NoiseSphere.cs +++ b/OpenSim/Region/Environment/Modules/World/Terrain/PaintBrushes/NoiseSphere.cs | |||
@@ -39,13 +39,14 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.PaintBrushes | |||
39 | { | 39 | { |
40 | strength = TerrainUtil.MetersToSphericalStrength(strength); | 40 | strength = TerrainUtil.MetersToSphericalStrength(strength); |
41 | 41 | ||
42 | int x, y; | 42 | int x; |
43 | for (x = 0; x < map.Width; x++) | 43 | for (x = 0; x < map.Width; x++) |
44 | { | 44 | { |
45 | // Skip everything unlikely to be affected | 45 | // Skip everything unlikely to be affected |
46 | if (Math.Abs(x - rx) > strength * 1.1) | 46 | if (Math.Abs(x - rx) > strength * 1.1) |
47 | continue; | 47 | continue; |
48 | 48 | ||
49 | int y; | ||
49 | for (y = 0; y < map.Height; y++) | 50 | for (y = 0; y < map.Height; y++) |
50 | { | 51 | { |
51 | // Skip everything unlikely to be affected | 52 | // Skip everything unlikely to be affected |
@@ -57,7 +58,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.PaintBrushes | |||
57 | z *= z; | 58 | z *= z; |
58 | z -= ((x - rx) * (x - rx)) + ((y - ry) * (y - ry)); | 59 | z -= ((x - rx) * (x - rx)) + ((y - ry) * (y - ry)); |
59 | 60 | ||
60 | double noise = TerrainUtil.PerlinNoise2D((double) x / (double) Constants.RegionSize, (double) y / (double) Constants.RegionSize, 8, 1.0); | 61 | double noise = TerrainUtil.PerlinNoise2D(x / (double) Constants.RegionSize, y / (double) Constants.RegionSize, 8, 1.0); |
61 | 62 | ||
62 | if (z > 0.0) | 63 | if (z > 0.0) |
63 | map[x, y] += noise * z * duration; | 64 | map[x, y] += noise * z * duration; |