From fae5d25e82aea351899c3d01b5ddb37f33b6852c Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Thu, 5 Feb 2009 21:54:22 +0000 Subject: * Apply http://opensimulator.org/mantis/view.php?id=3056 * Clamps negative values to zero when a terrain is exported in LLRAW format, since LLRAW doesn't support negative values. * Thanks jonc! --- .../Region/Environment/Modules/World/Terrain/FileLoaders/LLRAW.cs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'OpenSim/Region/Environment/Modules') diff --git a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/LLRAW.cs b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/LLRAW.cs index 88dd3a7..5158525 100644 --- a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/LLRAW.cs +++ b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/LLRAW.cs @@ -184,6 +184,13 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders for (int x = 0; x < map.Width; x++) { double t = map[x, (map.Height - 1) - y]; + //if height is less than 0, set it to 0 as + //can't save -ve values in a LLRAW file + if (t < 0d) + { + t = 0d; + } + int index = 0; // The lookup table is pre-sorted, so we either find an exact match or -- cgit v1.1