Applied patch from mantis #3820 which changed the clearing of the ScenePresence.m_forcesList, so it used the List.Clear method rather than doing a loop through the list and manually removing each item. Thanks dslake.

I also fixed the issue where the code also loops through the m_forcesList and copies each force to the ScenePresence's movementVector. Which resulted in only the last force in the list actually be acted on. As each copy overrode the last one. So now it only copies the last force in the list.
0.6.6-post-fixes
MW 2009-06-25 12:26:23 +00:00
parent c1976d1200
commit 684286f097
1 changed files with 17 additions and 21 deletions

View File

@ -3241,30 +3241,26 @@ namespace OpenSim.Region.Framework.Scenes
{
if (m_forcesList.Count > 0)
{
for (int i = 0; i < m_forcesList.Count; i++)
{
NewForce force = m_forcesList[i];
//we are only interested in the last force added to the list
NewForce force = m_forcesList[m_forcesList.Count - 1];
m_updateflag = true;
try
{
movementvector.X = force.X;
movementvector.Y = force.Y;
movementvector.Z = force.Z;
Velocity = movementvector;
}
catch (NullReferenceException)
{
// Under extreme load, this returns a NullReference Exception that we can ignore.
// Ignoring this causes no movement to be sent to the physics engine...
// which when the scene is moving at 1 frame every 10 seconds, it doesn't really matter!
}
m_newForce = true;
}
for (int i = 0; i < m_forcesList.Count; i++)
m_updateflag = true;
try
{
m_forcesList.RemoveAt(0);
movementvector.X = force.X;
movementvector.Y = force.Y;
movementvector.Z = force.Z;
Velocity = movementvector;
}
catch (NullReferenceException)
{
// Under extreme load, this returns a NullReference Exception that we can ignore.
// Ignoring this causes no movement to be sent to the physics engine...
// which when the scene is moving at 1 frame every 10 seconds, it doesn't really matter!
}
m_newForce = true;
m_forcesList.Clear();
}
}
}