aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorDr Scofield2009-03-31 12:45:34 +0000
committerDr Scofield2009-03-31 12:45:34 +0000
commitaecb4fb72a92bafc0a33ccfde4cbaa67ec5fb757 (patch)
tree2b9a8c4bea77c94f572c37dbba8ddfd72ff8a5f3
parentThank you, StrawberryFride, for a patch that adds offline inventory (diff)
downloadopensim-SC_OLD-aecb4fb72a92bafc0a33ccfde4cbaa67ec5fb757.zip
opensim-SC_OLD-aecb4fb72a92bafc0a33ccfde4cbaa67ec5fb757.tar.gz
opensim-SC_OLD-aecb4fb72a92bafc0a33ccfde4cbaa67ec5fb757.tar.bz2
opensim-SC_OLD-aecb4fb72a92bafc0a33ccfde4cbaa67ec5fb757.tar.xz
From: Alan M Webb <alan_webb@us.ibm.com>
Add sanity check to fly-height calculation so that it does not attempt to retrieve information from non-existent regions.
-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