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-25 23:54:53 +0000
commitaf5a3f2d7392ce6f86ef210c401956ca92cdb8e2 (patch)
tree973e46d4dd45814ac7737617b9bc94e5e1aece7f /OpenSim/Region
parentCheck the existing ScenePresence.ParentPart to make sure we're not trying to ... (diff)
downloadopensim-SC_OLD-af5a3f2d7392ce6f86ef210c401956ca92cdb8e2.zip
opensim-SC_OLD-af5a3f2d7392ce6f86ef210c401956ca92cdb8e2.tar.gz
opensim-SC_OLD-af5a3f2d7392ce6f86ef210c401956ca92cdb8e2.tar.bz2
opensim-SC_OLD-af5a3f2d7392ce6f86ef210c401956ca92cdb8e2.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 8bd3cf9..e92a087 100644
--- a/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs
+++ b/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs
@@ -112,7 +112,15 @@ namespace OpenSim.Region.Framework.Scenes.Animation
112 AddAnimation(animID, objectID); 112 AddAnimation(animID, objectID);
113 } 113 }
114 114
115 public void RemoveAnimation(UUID animID) 115 /// <summary>
116 /// Remove the specified animation
117 /// </summary>
118 /// <param name='animID'></param>
119 /// <param name='allowNoDefault'>
120 /// If true, then the default animation can be entirely removed.
121 /// If false, then removing the default animation will reset it to the simulator default (currently STAND).
122 /// </param>
123 public void RemoveAnimation(UUID animID, bool allowNoDefault)
116 { 124 {
117 if (m_scenePresence.IsChildAgent) 125 if (m_scenePresence.IsChildAgent)
118 return; 126 return;
@@ -122,7 +130,7 @@ namespace OpenSim.Region.Framework.Scenes.Animation
122 "[SCENE PRESENCE ANIMATOR]: Removing animation {0} {1} for {2}", 130 "[SCENE PRESENCE ANIMATOR]: Removing animation {0} {1} for {2}",
123 GetAnimName(animID), animID, m_scenePresence.Name); 131 GetAnimName(animID), animID, m_scenePresence.Name);
124 132
125 if (m_animations.Remove(animID)) 133 if (m_animations.Remove(animID, allowNoDefault))
126 SendAnimPack(); 134 SendAnimPack();
127 } 135 }
128 136
@@ -138,7 +146,7 @@ namespace OpenSim.Region.Framework.Scenes.Animation
138 if (animID == UUID.Zero) 146 if (animID == UUID.Zero)
139 return; 147 return;
140 148
141 RemoveAnimation(animID); 149 RemoveAnimation(animID, true);
142 } 150 }
143 151
144 public void ResetAnimations() 152 public void ResetAnimations()
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index db2e95e..a90872e 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -2259,7 +2259,7 @@ namespace OpenSim.Region.Framework.Scenes
2259 2259
2260 public void HandleStopAnim(IClientAPI remoteClient, UUID animID) 2260 public void HandleStopAnim(IClientAPI remoteClient, UUID animID)
2261 { 2261 {
2262 Animator.RemoveAnimation(animID); 2262 Animator.RemoveAnimation(animID, false);
2263 } 2263 }
2264 2264
2265 /// <summary> 2265 /// <summary>
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index 2bdf38b..2493a15 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -3341,7 +3341,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
3341 if (animID == UUID.Zero) 3341 if (animID == UUID.Zero)
3342 presence.Animator.RemoveAnimation(anim); 3342 presence.Animator.RemoveAnimation(anim);
3343 else 3343 else
3344 presence.Animator.RemoveAnimation(animID); 3344 presence.Animator.RemoveAnimation(animID, true);
3345 } 3345 }
3346 } 3346 }
3347 } 3347 }
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
index 828288d..dcc85c4 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
@@ -974,7 +974,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
974 if (animID == UUID.Zero) 974 if (animID == UUID.Zero)
975 target.Animator.RemoveAnimation(animation); 975 target.Animator.RemoveAnimation(animation);
976 else 976 else
977 target.Animator.RemoveAnimation(animID); 977 target.Animator.RemoveAnimation(animID, true);
978 } 978 }
979 } 979 }
980 } 980 }