diff options
Diffstat (limited to 'OpenSim/Region/Framework')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs b/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs index 4d1d913..db3b834 100644 --- a/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs +++ b/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs | |||
@@ -181,12 +181,19 @@ namespace OpenSim.Region.Framework.Scenes.Animation | |||
181 | 181 | ||
182 | m_animations.Clear(); | 182 | m_animations.Clear(); |
183 | } | 183 | } |
184 | 184 | ||
185 | |||
186 | UUID aoSitGndAnim = UUID.Zero; | ||
187 | |||
185 | /// <summary> | 188 | /// <summary> |
186 | /// The movement animation is reserved for "main" animations | 189 | /// The movement animation is reserved for "main" animations |
187 | /// that are mutually exclusive, e.g. flying and sitting. | 190 | /// that are mutually exclusive, e.g. flying and sitting. |
188 | /// </summary> | 191 | /// </summary> |
189 | /// <returns>'true' if the animation was updated</returns> | 192 | /// <returns>'true' if the animation was updated</returns> |
193 | /// | ||
194 | |||
195 | |||
196 | |||
190 | public bool TrySetMovementAnimation(string anim) | 197 | public bool TrySetMovementAnimation(string anim) |
191 | { | 198 | { |
192 | bool ret = false; | 199 | bool ret = false; |
@@ -196,10 +203,28 @@ namespace OpenSim.Region.Framework.Scenes.Animation | |||
196 | // "[SCENE PRESENCE ANIMATOR]: Setting movement animation {0} for {1}", | 203 | // "[SCENE PRESENCE ANIMATOR]: Setting movement animation {0} for {1}", |
197 | // anim, m_scenePresence.Name); | 204 | // anim, m_scenePresence.Name); |
198 | 205 | ||
206 | if (aoSitGndAnim != UUID.Zero) | ||
207 | { | ||
208 | avnChangeAnim(aoSitGndAnim, false, false); | ||
209 | aoSitGndAnim = UUID.Zero; | ||
210 | } | ||
211 | |||
199 | UUID overridenAnim = m_scenePresence.Overrides.GetOverriddenAnimation(anim); | 212 | UUID overridenAnim = m_scenePresence.Overrides.GetOverriddenAnimation(anim); |
200 | if (overridenAnim != UUID.Zero) | 213 | if (overridenAnim != UUID.Zero) |
201 | { | 214 | { |
202 | m_animations.SetDefaultAnimation(overridenAnim, m_scenePresence.ControllingClient.NextAnimationSequenceNumber, m_scenePresence.UUID); | 215 | if (anim == "SITGROUND") |
216 | { | ||
217 | UUID defsit = DefaultAvatarAnimations.AnimsUUID["SIT_GROUND_CONSTRAINED"]; | ||
218 | if (defsit == UUID.Zero) | ||
219 | return false; | ||
220 | m_animations.SetDefaultAnimation(defsit, m_scenePresence.ControllingClient.NextAnimationSequenceNumber, m_scenePresence.UUID); | ||
221 | aoSitGndAnim = overridenAnim; | ||
222 | avnChangeAnim(overridenAnim, true, false); | ||
223 | } | ||
224 | else | ||
225 | { | ||
226 | m_animations.SetDefaultAnimation(overridenAnim, m_scenePresence.ControllingClient.NextAnimationSequenceNumber, m_scenePresence.UUID); | ||
227 | } | ||
203 | m_scenePresence.SendScriptEventToAttachments("changed", new Object[] { (int)Changed.ANIMATION }); | 228 | m_scenePresence.SendScriptEventToAttachments("changed", new Object[] { (int)Changed.ANIMATION }); |
204 | SendAnimPack(); | 229 | SendAnimPack(); |
205 | ret = true; | 230 | ret = true; |