From 8b6dd623bd7e7a1ea3de196ea6bc4d8979c7e921 Mon Sep 17 00:00:00 2001 From: Adam Frisby Date: Thu, 27 Dec 2007 05:20:03 +0000 Subject: [PATCH] * Added osTerrainSetHeight(int x, int y, double val) to LSL commands * Added osTerrainGetHeight(int x, int y) to LSL commands --- .../Compiler/Server_API/LSL_BuiltIn_Commands.cs | 11 +++++++++++ .../Region/Terrain.BasicTerrain/TerrainEngine.cs | 15 +++++++++++++++ prebuild.xml | 1 + 3 files changed, 27 insertions(+) diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/Server_API/LSL_BuiltIn_Commands.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/Server_API/LSL_BuiltIn_Commands.cs index fb521dff65..14f66e8944 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/Server_API/LSL_BuiltIn_Commands.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/Server_API/LSL_BuiltIn_Commands.cs @@ -2876,6 +2876,17 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler // // OpenSim functions // + public int osTerrainSetHeight(int x, int y, double val) + { + World.Terrain.Set(x, y, val); + return 1; + } + + public double osTerrainGetHeight(int x, int y) + { + return World.Terrain.GetHeight(x, y); + } + public string osSetDynamicTextureURL(string dynamicID, string contentType, string url, string extraParams, int timer) { diff --git a/OpenSim/Region/Terrain.BasicTerrain/TerrainEngine.cs b/OpenSim/Region/Terrain.BasicTerrain/TerrainEngine.cs index f29f42a57d..e89ff6286b 100644 --- a/OpenSim/Region/Terrain.BasicTerrain/TerrainEngine.cs +++ b/OpenSim/Region/Terrain.BasicTerrain/TerrainEngine.cs @@ -1121,6 +1121,21 @@ namespace OpenSim.Region.Terrain heightmap.seed = val; } + /// + /// Sets a particular heightmap point to a specified value + /// + /// X Coordinate + /// Y Coordinate + /// Value + public void Set(int x, int y, double val) + { + lock (heightmap) + { + heightmap.Set(x, y, val); + } + tainted++; + } + /// /// Raises land in a sphere around the specified coordinates /// diff --git a/prebuild.xml b/prebuild.xml index 7a6317c1eb..4827a3dc38 100644 --- a/prebuild.xml +++ b/prebuild.xml @@ -1115,6 +1115,7 @@ +