From e575ef7ad2245aad17f57273f6bd7b774f99f057 Mon Sep 17 00:00:00 2001
From: Charles Krinke
Date: Mon, 6 Oct 2008 00:58:43 +0000
Subject: Revert r6697 patch as the build fails.
---
.../Modules/World/Terrain/TerrainModule.cs | 97 ++++++----------------
1 file changed, 25 insertions(+), 72 deletions(-)
(limited to 'OpenSim/Region/Environment/Modules/World/Terrain/TerrainModule.cs')
diff --git a/OpenSim/Region/Environment/Modules/World/Terrain/TerrainModule.cs b/OpenSim/Region/Environment/Modules/World/Terrain/TerrainModule.cs
index 3b8debb..ed4075c 100644
--- a/OpenSim/Region/Environment/Modules/World/Terrain/TerrainModule.cs
+++ b/OpenSim/Region/Environment/Modules/World/Terrain/TerrainModule.cs
@@ -40,7 +40,6 @@ using OpenSim.Region.Environment.Modules.World.Terrain.FloodBrushes;
using OpenSim.Region.Environment.Modules.World.Terrain.PaintBrushes;
using OpenSim.Region.Environment.Scenes;
-
namespace OpenSim.Region.Environment.Modules.World.Terrain
{
public class TerrainModule : IRegionModule, ICommandableModule, ITerrainModule
@@ -260,18 +259,6 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain
}
///
- /// Modify Land
- ///
- /// Land-position (X,Y,0)
- /// The size of the brush (0=small, 1=medium, 2=large)
- /// 0=LAND_LEVEL, 1=LAND_RAISE, 2=LAND_LOWER, 3=LAND_SMOOTH, 4=LAND_NOISE, 5=LAND_REVERT
- /// UUID of script-owner
- public void ModifyTerrain(Vector3 pos, byte size, byte action, UUID agentId)
- {
- client_OnModifyTerrain((float)pos.Z, (float)0.25, size, action, pos.Y, pos.X, pos.Y, pos.X, agentId);
- }
-
- ///
/// Saves the current heightmap to a specified stream.
///
/// The destination filename. Used here only to identify the image type
@@ -600,92 +587,58 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain
);
}
- private void client_OnModifyTerrain(float height, float seconds, byte size, byte action,
- float north, float west, float south, float east, UUID agentId)
+ private void client_OnModifyTerrain(float height, float seconds, byte size, byte action, float north, float west,
+ float south, float east, IClientAPI remoteClient)
{
- bool allowed = false;
- if (north == south && east == west)
+ // Not a good permissions check, if in area mode, need to check the entire area.
+ if (m_scene.ExternalChecks.ExternalChecksCanTerraformLand(remoteClient.AgentId, new Vector3(north, west, 0)))
{
- if (m_painteffects.ContainsKey((StandardTerrainEffects) action))
+ if (north == south && east == west)
{
- bool[,] allowMask = new bool[m_channel.Width,m_channel.Height];
- allowMask.Initialize();
- int n = size + 1;
- if (n > 2)
- n = 4;
-
- int zx = (int) (west + 0.5);
- int zy = (int) (north + 0.5);
-
- int dx;
- for (dx=-n; dx<=n; dx++)
- {
- int dy;
- for (dy=-n; dy<=n; dy++)
- {
- int x = zx + dx;
- int y = zy + dy;
- if (x>=0 && y>=0 && x west)
+ int y;
+ for (y = 0; y < m_channel.Height; y++)
{
- if (y < north && y > south)
+ if (x < east && x > west)
{
- if (m_scene.ExternalChecks.ExternalChecksCanTerraformLand(agentId, new Vector3(x,y,0)))
+ if (y < north && y > south)
{
fillArea[x, y] = true;
- allowed = true;
}
}
}
}
- }
- if (allowed)
- {
m_floodeffects[(StandardTerrainEffects) action].FloodEffect(
m_channel, fillArea, size);
CheckForTerrainUpdates(true); //revert changes outside estate limits
}
- }
- else
- {
- m_log.Debug("Unknown terrain flood type " + action);
+ else
+ {
+ m_log.Debug("Unknown terrain flood type " + action);
+ }
}
}
}
--
cgit v1.1