aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2013-01-18 22:57:09 +0000
committerJustin Clark-Casey (justincc)2013-01-18 22:57:09 +0000
commit74256c0cc47870f6057b64ce117479af79f02ab0 (patch)
tree9bdc9e66f6e668a06a22ee3a2f772855293e4b5a /OpenSim/Region
parentBulletSim: reduce jitter in avatar velocity when walking or flying. (diff)
downloadopensim-SC_OLD-74256c0cc47870f6057b64ce117479af79f02ab0.zip
opensim-SC_OLD-74256c0cc47870f6057b64ce117479af79f02ab0.tar.gz
opensim-SC_OLD-74256c0cc47870f6057b64ce117479af79f02ab0.tar.bz2
opensim-SC_OLD-74256c0cc47870f6057b64ce117479af79f02ab0.tar.xz
Restore previous client AO behaviour by not allowing them to remove the default animation but continue to allow scripts to do so.
This keeps the fix from http://opensimulator.org/mantis/view.php?id=6327 and fixes the behaviour regression in http://opensimulator.org/mantis/view.php?id=6483 Animations may still exhibit different behaviour if both scripts and clients are adjusting animations. A change in the behaviour of client AO to not remove all animations may be a better long term approach.
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/Framework/Scenes/Animation/AnimationSet.cs15
-rw-r--r--OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs14
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs2
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs2
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs2
5 files changed, 27 insertions, 8 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Animation/AnimationSet.cs b/OpenSim/Region/Framework/Scenes/Animation/AnimationSet.cs
index 65ae445..66edfed 100644
--- a/OpenSim/Region/Framework/Scenes/Animation/AnimationSet.cs
+++ b/OpenSim/Region/Framework/Scenes/Animation/AnimationSet.cs
@@ -87,13 +87,24 @@ namespace OpenSim.Region.Framework.Scenes.Animation
87 return false; 87 return false;
88 } 88 }
89 89
90 public bool Remove(UUID animID) 90 /// <summary>
91 /// Remove the specified animation
92 /// </summary>
93 /// <param name='animID'></param>
94 /// <param name='allowNoDefault'>
95 /// If true, then the default animation can be entirely removed.
96 /// If false, then removing the default animation will reset it to the simulator default (currently STAND).
97 /// </param>
98 public bool Remove(UUID animID, bool allowNoDefault)
91 { 99 {
92 lock (m_animations) 100 lock (m_animations)
93 { 101 {
94 if (m_defaultAnimation.AnimID == animID) 102 if (m_defaultAnimation.AnimID == animID)
95 { 103 {
96 m_defaultAnimation = new OpenSim.Framework.Animation(UUID.Zero, 1, UUID.Zero); 104 if (allowNoDefault)
105 m_defaultAnimation = new OpenSim.Framework.Animation(UUID.Zero, 1, UUID.Zero);
106 else
107 ResetDefaultAnimation();
97 } 108 }
98 else if (HasAnimation(animID)) 109 else if (HasAnimation(animID))
99 { 110 {
diff --git a/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs b/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs
index 5b16b67..3657dc4 100644
--- a/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs
+++ b/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs
@@ -109,14 +109,22 @@ namespace OpenSim.Region.Framework.Scenes.Animation
109 AddAnimation(animID, objectID); 109 AddAnimation(animID, objectID);
110 } 110 }
111 111
112 public void RemoveAnimation(UUID animID) 112 /// <summary>
113 /// Remove the specified animation
114 /// </summary>
115 /// <param name='animID'></param>
116 /// <param name='allowNoDefault'>
117 /// If true, then the default animation can be entirely removed.
118 /// If false, then removing the default animation will reset it to the simulator default (currently STAND).
119 /// </param>
120 public void RemoveAnimation(UUID animID, bool allowNoDefault)
113 { 121 {
114 if (m_scenePresence.IsChildAgent) 122 if (m_scenePresence.IsChildAgent)
115 return; 123 return;
116 124
117// m_log.DebugFormat("[SCENE PRESENCE ANIMATOR]: Removing animation {0} for {1}", animID, m_scenePresence.Name); 125// m_log.DebugFormat("[SCENE PRESENCE ANIMATOR]: Removing animation {0} for {1}", animID, m_scenePresence.Name);
118 126
119 if (m_animations.Remove(animID)) 127 if (m_animations.Remove(animID, allowNoDefault))
120 SendAnimPack(); 128 SendAnimPack();
121 } 129 }
122 130
@@ -132,7 +140,7 @@ namespace OpenSim.Region.Framework.Scenes.Animation
132 if (animID == UUID.Zero) 140 if (animID == UUID.Zero)
133 return; 141 return;
134 142
135 RemoveAnimation(animID); 143 RemoveAnimation(animID, true);
136 } 144 }
137 145
138 public void ResetAnimations() 146 public void ResetAnimations()
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index 6979c33..c295305 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -2260,7 +2260,7 @@ namespace OpenSim.Region.Framework.Scenes
2260 2260
2261 public void HandleStopAnim(IClientAPI remoteClient, UUID animID) 2261 public void HandleStopAnim(IClientAPI remoteClient, UUID animID)
2262 { 2262 {
2263 Animator.RemoveAnimation(animID); 2263 Animator.RemoveAnimation(animID, false);
2264 } 2264 }
2265 2265
2266 /// <summary> 2266 /// <summary>
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index d47fd6b..a2f1ff2 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -3364,7 +3364,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
3364 if (animID == UUID.Zero) 3364 if (animID == UUID.Zero)
3365 presence.Animator.RemoveAnimation(anim); 3365 presence.Animator.RemoveAnimation(anim);
3366 else 3366 else
3367 presence.Animator.RemoveAnimation(animID); 3367 presence.Animator.RemoveAnimation(animID, true);
3368 } 3368 }
3369 } 3369 }
3370 } 3370 }
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
index 25635ff..5c0ff1c 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
@@ -986,7 +986,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
986 if (animID == UUID.Zero) 986 if (animID == UUID.Zero)
987 target.Animator.RemoveAnimation(animation); 987 target.Animator.RemoveAnimation(animation);
988 else 988 else
989 target.Animator.RemoveAnimation(animID); 989 target.Animator.RemoveAnimation(animID, true);
990 } 990 }
991 } 991 }
992 } 992 }