mirror of
https://github.com/opensim/opensim.git
synced 2026-08-06 01:06:30 +08:00
* 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.
This commit is contained in:
@@ -2126,9 +2126,30 @@ Console.WriteLine(" JointCreateFixed");
|
||||
if (IsPhysical)
|
||||
{
|
||||
Vector3 iforce = Vector3.Zero;
|
||||
for (int i = 0; i < m_forcelist.Count; i++)
|
||||
int i = 0;
|
||||
try
|
||||
{
|
||||
iforce = iforce + (m_forcelist[i] * 100);
|
||||
for (i = 0; i < m_forcelist.Count; i++)
|
||||
{
|
||||
|
||||
iforce = iforce + (m_forcelist[i] * 100);
|
||||
}
|
||||
}
|
||||
catch (IndexOutOfRangeException)
|
||||
{
|
||||
m_forcelist = new List<Vector3>();
|
||||
m_collisionscore = 0;
|
||||
m_interpenetrationcount = 0;
|
||||
m_taintforce = false;
|
||||
return;
|
||||
}
|
||||
catch (ArgumentOutOfRangeException)
|
||||
{
|
||||
m_forcelist = new List<Vector3>();
|
||||
m_collisionscore = 0;
|
||||
m_interpenetrationcount = 0;
|
||||
m_taintforce = false;
|
||||
return;
|
||||
}
|
||||
d.BodyEnable(Body);
|
||||
d.BodyAddForce(Body, iforce.X, iforce.Y, iforce.Z);
|
||||
@@ -2462,7 +2483,9 @@ Console.WriteLine(" JointCreateFixed");
|
||||
{
|
||||
if (force.IsFinite())
|
||||
{
|
||||
m_forcelist.Add(force);
|
||||
lock (m_forcelist)
|
||||
m_forcelist.Add(force);
|
||||
|
||||
m_taintforce = true;
|
||||
}
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user