aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics/OdePlugin
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Physics/OdePlugin')
-rw-r--r--OpenSim/Region/Physics/OdePlugin/OdePlugin.cs10
1 files changed, 9 insertions, 1 deletions
diff --git a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs
index e3ac668..9451ad9 100644
--- a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs
+++ b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs
@@ -1297,6 +1297,9 @@ namespace OpenSim.Region.Physics.OdePlugin
1297// Recovered for use by fly height. Kitto Flora 1297// Recovered for use by fly height. Kitto Flora
1298 public float GetTerrainHeightAtXY(float x, float y) 1298 public float GetTerrainHeightAtXY(float x, float y)
1299 { 1299 {
1300
1301 int index;
1302
1300 // Teravus: Kitto, this code causes recurring errors that stall physics permenantly unless 1303 // Teravus: Kitto, this code causes recurring errors that stall physics permenantly unless
1301 // the values are checked, so checking below. 1304 // the values are checked, so checking below.
1302 // Is there any reason that we don't do this in ScenePresence? 1305 // Is there any reason that we don't do this in ScenePresence?
@@ -1306,7 +1309,12 @@ namespace OpenSim.Region.Physics.OdePlugin
1306 (int)x < 0.001f || (int)y < 0.001f) 1309 (int)x < 0.001f || (int)y < 0.001f)
1307 return 0; 1310 return 0;
1308 1311
1309 return (float)_origheightmap[(int)y * Constants.RegionSize + (int)x]; 1312 index = (int) ((int)y * Constants.RegionSize + (int)x);
1313
1314 if (index < _origheightmap.Length)
1315 return (float)_origheightmap[(int)y * Constants.RegionSize + (int)x];
1316 else
1317 return 0;
1310 } 1318 }
1311// End recovered. Kitto Flora 1319// End recovered. Kitto Flora
1312 1320