From 1011bbf39de19a03487ecf246569f0e7ca54d775 Mon Sep 17 00:00:00 2001 From: Adam Frisby Date: Sat, 8 Mar 2008 23:28:29 +0000 Subject: * Small optimisation on Weathering paint brush. * Added "script terrain newbrushes " to enable experimental terraforming brushes. Presently the 'revert' brush is replaced with the Weathering brush, when enabled. --- .../Environment/Modules/Terrain/PaintBrushes/WeatherSphere.cs | 8 ++++---- OpenSim/Region/Environment/Modules/Terrain/TerrainModule.cs | 10 ++++++++++ 2 files changed, 14 insertions(+), 4 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/Environment/Modules/Terrain/PaintBrushes/WeatherSphere.cs b/OpenSim/Region/Environment/Modules/Terrain/PaintBrushes/WeatherSphere.cs index 17207f8..bede47e 100644 --- a/OpenSim/Region/Environment/Modules/Terrain/PaintBrushes/WeatherSphere.cs +++ b/OpenSim/Region/Environment/Modules/Terrain/PaintBrushes/WeatherSphere.cs @@ -211,13 +211,13 @@ namespace OpenSim.Region.Environment.Modules.Terrain.PaintBrushes coords[1] += y; if (coords[0] > map.Width - 1) - coords[0] = map.Width - 1; + continue; if (coords[1] > map.Height - 1) - coords[1] = map.Height - 1; + continue; if (coords[0] < 0) - coords[0] = 0; + continue; if (coords[1] < 0) - coords[1] = 0; + continue; double heightF = map[x, y]; double target = map[coords[0], coords[1]]; diff --git a/OpenSim/Region/Environment/Modules/Terrain/TerrainModule.cs b/OpenSim/Region/Environment/Modules/Terrain/TerrainModule.cs index 6f9adc9..ca07443 100644 --- a/OpenSim/Region/Environment/Modules/Terrain/TerrainModule.cs +++ b/OpenSim/Region/Environment/Modules/Terrain/TerrainModule.cs @@ -332,6 +332,16 @@ namespace OpenSim.Region.Environment.Modules.Terrain m_channel[x, y] = Double.Parse(param); SendUpdatedLayerData(); break; + case "newbrushes": + if (Boolean.Parse(param)) + { + m_painteffects[StandardTerrainEffects.Revert] = new PaintBrushes.WeatherSphere(); + } + else + { + InstallDefaultEffects(); + } + break; default: m_log.Warn("Unknown terrain command."); break; -- cgit v1.1