diff options
Diffstat (limited to 'OpenSim/Region')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/ScenePresence.cs | 36 |
1 files changed, 16 insertions, 20 deletions
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index f4776e3..cc25f48 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -3241,30 +3241,26 @@ namespace OpenSim.Region.Framework.Scenes | |||
3241 | { | 3241 | { |
3242 | if (m_forcesList.Count > 0) | 3242 | if (m_forcesList.Count > 0) |
3243 | { | 3243 | { |
3244 | for (int i = 0; i < m_forcesList.Count; i++) | 3244 | //we are only interested in the last force added to the list |
3245 | { | 3245 | NewForce force = m_forcesList[m_forcesList.Count - 1]; |
3246 | NewForce force = m_forcesList[i]; | ||
3247 | 3246 | ||
3248 | m_updateflag = true; | 3247 | m_updateflag = true; |
3249 | try | 3248 | try |
3250 | { | 3249 | { |
3251 | movementvector.X = force.X; | 3250 | movementvector.X = force.X; |
3252 | movementvector.Y = force.Y; | 3251 | movementvector.Y = force.Y; |
3253 | movementvector.Z = force.Z; | 3252 | movementvector.Z = force.Z; |
3254 | Velocity = movementvector; | 3253 | Velocity = movementvector; |
3255 | } | ||
3256 | catch (NullReferenceException) | ||
3257 | { | ||
3258 | // Under extreme load, this returns a NullReference Exception that we can ignore. | ||
3259 | // Ignoring this causes no movement to be sent to the physics engine... | ||
3260 | // which when the scene is moving at 1 frame every 10 seconds, it doesn't really matter! | ||
3261 | } | ||
3262 | m_newForce = true; | ||
3263 | } | 3254 | } |
3264 | for (int i = 0; i < m_forcesList.Count; i++) | 3255 | catch (NullReferenceException) |
3265 | { | 3256 | { |
3266 | m_forcesList.RemoveAt(0); | 3257 | // Under extreme load, this returns a NullReference Exception that we can ignore. |
3258 | // Ignoring this causes no movement to be sent to the physics engine... | ||
3259 | // which when the scene is moving at 1 frame every 10 seconds, it doesn't really matter! | ||
3267 | } | 3260 | } |
3261 | m_newForce = true; | ||
3262 | |||
3263 | m_forcesList.Clear(); | ||
3268 | } | 3264 | } |
3269 | } | 3265 | } |
3270 | } | 3266 | } |