aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorTeravus Ovares (Dan Olivares)2009-11-22 21:08:54 -0500
committerTeravus Ovares (Dan Olivares)2009-11-22 21:08:54 -0500
commit9ba10af6b20712a09a9b0c92a650c96dbbede2f2 (patch)
treef57c24618c1df5a8fc4eee873bdd1a26619b4449 /OpenSim
parent* This doesn't fix mantis 3522, but it should mitigate it. (diff)
downloadopensim-SC_OLD-9ba10af6b20712a09a9b0c92a650c96dbbede2f2.zip
opensim-SC_OLD-9ba10af6b20712a09a9b0c92a650c96dbbede2f2.tar.gz
opensim-SC_OLD-9ba10af6b20712a09a9b0c92a650c96dbbede2f2.tar.bz2
opensim-SC_OLD-9ba10af6b20712a09a9b0c92a650c96dbbede2f2.tar.xz
* Added missing lock to m_forcelist when AddForce is called. When a user dragged a prim, in some cases, it would corrupt the datatype in memory and throw spurious IndexOutOfRangeExceptions.
* Physics a situation that causes physics to spew redline messages to the console forever.
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Region/Physics/OdePlugin/ODEPrim.cs29
1 files changed, 26 insertions, 3 deletions
diff --git a/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs b/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs
index 6f14f7b..17552d2 100644
--- a/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs
+++ b/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs
@@ -2126,9 +2126,30 @@ Console.WriteLine(" JointCreateFixed");
2126 if (IsPhysical) 2126 if (IsPhysical)
2127 { 2127 {
2128 Vector3 iforce = Vector3.Zero; 2128 Vector3 iforce = Vector3.Zero;
2129 for (int i = 0; i < m_forcelist.Count; i++) 2129 int i = 0;
2130 try
2131 {
2132 for (i = 0; i < m_forcelist.Count; i++)
2133 {
2134
2135 iforce = iforce + (m_forcelist[i] * 100);
2136 }
2137 }
2138 catch (IndexOutOfRangeException)
2139 {
2140 m_forcelist = new List<Vector3>();
2141 m_collisionscore = 0;
2142 m_interpenetrationcount = 0;
2143 m_taintforce = false;
2144 return;
2145 }
2146 catch (ArgumentOutOfRangeException)
2130 { 2147 {
2131 iforce = iforce + (m_forcelist[i] * 100); 2148 m_forcelist = new List<Vector3>();
2149 m_collisionscore = 0;
2150 m_interpenetrationcount = 0;
2151 m_taintforce = false;
2152 return;
2132 } 2153 }
2133 d.BodyEnable(Body); 2154 d.BodyEnable(Body);
2134 d.BodyAddForce(Body, iforce.X, iforce.Y, iforce.Z); 2155 d.BodyAddForce(Body, iforce.X, iforce.Y, iforce.Z);
@@ -2462,7 +2483,9 @@ Console.WriteLine(" JointCreateFixed");
2462 { 2483 {
2463 if (force.IsFinite()) 2484 if (force.IsFinite())
2464 { 2485 {
2465 m_forcelist.Add(force); 2486 lock (m_forcelist)
2487 m_forcelist.Add(force);
2488
2466 m_taintforce = true; 2489 m_taintforce = true;
2467 } 2490 }
2468 else 2491 else