aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
Diffstat (limited to '')
-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