aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Physics/OdePlugin/ODEPrim.cs')
-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 c7e0848..b0e9a91 100644
--- a/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs
+++ b/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs
@@ -2185,9 +2185,30 @@ Console.WriteLine(" JointCreateFixed");
2185 if (IsPhysical) 2185 if (IsPhysical)
2186 { 2186 {
2187 Vector3 iforce = Vector3.Zero; 2187 Vector3 iforce = Vector3.Zero;
2188 for (int i = 0; i < m_forcelist.Count; i++) 2188 int i = 0;
2189 try
2190 {
2191 for (i = 0; i < m_forcelist.Count; i++)
2192 {
2193
2194 iforce = iforce + (m_forcelist[i] * 100);
2195 }
2196 }
2197 catch (IndexOutOfRangeException)
2198 {
2199 m_forcelist = new List<Vector3>();
2200 m_collisionscore = 0;
2201 m_interpenetrationcount = 0;
2202 m_taintforce = false;
2203 return;
2204 }
2205 catch (ArgumentOutOfRangeException)
2189 { 2206 {
2190 iforce = iforce + (m_forcelist[i] * 100); 2207 m_forcelist = new List<Vector3>();
2208 m_collisionscore = 0;
2209 m_interpenetrationcount = 0;
2210 m_taintforce = false;
2211 return;
2191 } 2212 }
2192 d.BodyEnable(Body); 2213 d.BodyEnable(Body);
2193 d.BodyAddForce(Body, iforce.X, iforce.Y, iforce.Z); 2214 d.BodyAddForce(Body, iforce.X, iforce.Y, iforce.Z);
@@ -2521,7 +2542,9 @@ Console.WriteLine(" JointCreateFixed");
2521 { 2542 {
2522 if (force.IsFinite()) 2543 if (force.IsFinite())
2523 { 2544 {
2524 m_forcelist.Add(force); 2545 lock (m_forcelist)
2546 m_forcelist.Add(force);
2547
2525 m_taintforce = true; 2548 m_taintforce = true;
2526 } 2549 }
2527 else 2550 else