From 8b6dd623bd7e7a1ea3de196ea6bc4d8979c7e921 Mon Sep 17 00:00:00 2001
From: Adam Frisby
Date: Thu, 27 Dec 2007 05:20:03 +0000
Subject: * 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 +++++++++++
OpenSim/Region/Terrain.BasicTerrain/TerrainEngine.cs | 15 +++++++++++++++
2 files changed, 26 insertions(+)
(limited to 'OpenSim')
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 fb521df..14f66e8 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 f29f42a..e89ff62 100644
--- a/OpenSim/Region/Terrain.BasicTerrain/TerrainEngine.cs
+++ b/OpenSim/Region/Terrain.BasicTerrain/TerrainEngine.cs
@@ -1122,6 +1122,21 @@ namespace OpenSim.Region.Terrain
}
///
+ /// 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
///
/// Center of the sphere on the X axis
--
cgit v1.1