From 3c47fd2cb228c47997ce8a0bc7f40d1e23047b36 Mon Sep 17 00:00:00 2001
From: Adam Frisby <adam@gwala.net>
Date: Wed, 28 May 2008 23:52:24 +0000
Subject: [PATCH] * Fixed a slight issue with the LLRAW exporter. * Linden uses
 a neutral height channel of 128.0 on their multiplier. OpenSim was using a
 neutral of 127.0 - this has been changed to 128.0, this may cause files
 exported to the .RAW format to look slightly different when loaded back in -
 it is highly recommended to use the R32 format instead which avoids these
 sorts of issues. * Made a tweak to the Terrain Plugin loading process.

---
 .../Environment/Modules/World/Terrain/FileLoaders/LLRAW.cs    | 4 ++--
 .../Region/Environment/Modules/World/Terrain/TerrainModule.cs | 3 ++-
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/LLRAW.cs b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/LLRAW.cs
index 2e8fa9e40f..85afaf8e34 100644
--- a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/LLRAW.cs
+++ b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/LLRAW.cs
@@ -61,7 +61,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders
             {
                 for (int j = 0; j < 256; j++)
                 {
-                    LookupHeightTable[i + (j * 256)] = new HeightmapLookupValue(i + (j * 256), ((double)i * ((double)j / 127.0d)));
+                    LookupHeightTable[i + (j * 256)] = new HeightmapLookupValue(i + (j * 256), ((double)i * ((double)j / 128.0d)));
                 }
             }
             Array.Sort<HeightmapLookupValue>(LookupHeightTable);
@@ -82,7 +82,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders
                 int x;
                 for (x = 0; x < retval.Width; x++)
                 {
-                    retval[x, y] = bs.ReadByte() * (bs.ReadByte() / 127.0);
+                    retval[x, y] = bs.ReadByte() * (bs.ReadByte() / 128.0);
                     bs.ReadBytes(11); // Advance the stream to next bytes.
                 }
             }
diff --git a/OpenSim/Region/Environment/Modules/World/Terrain/TerrainModule.cs b/OpenSim/Region/Environment/Modules/World/Terrain/TerrainModule.cs
index 20c00869fb..e2b7fb2f96 100644
--- a/OpenSim/Region/Environment/Modules/World/Terrain/TerrainModule.cs
+++ b/OpenSim/Region/Environment/Modules/World/Terrain/TerrainModule.cs
@@ -279,7 +279,8 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain
                 }
                 else
                 {
-                    m_log.Warn("E ... " + pluginName + " (Skipping)");
+                    m_plugineffects[pluginName] = effect;
+                    m_log.Warn("E ... " + pluginName + " (Replaced)");
                 }
             }
         }