handle AO sit ground case
parent
f66b58cf00
commit
df8eae1957
|
@ -182,11 +182,18 @@ namespace OpenSim.Region.Framework.Scenes.Animation
|
||||||
m_animations.Clear();
|
m_animations.Clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
UUID aoSitGndAnim = UUID.Zero;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The movement animation is reserved for "main" animations
|
/// The movement animation is reserved for "main" animations
|
||||||
/// that are mutually exclusive, e.g. flying and sitting.
|
/// that are mutually exclusive, e.g. flying and sitting.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns>'true' if the animation was updated</returns>
|
/// <returns>'true' if the animation was updated</returns>
|
||||||
|
///
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public bool TrySetMovementAnimation(string anim)
|
public bool TrySetMovementAnimation(string anim)
|
||||||
{
|
{
|
||||||
bool ret = false;
|
bool ret = false;
|
||||||
|
@ -196,10 +203,28 @@ namespace OpenSim.Region.Framework.Scenes.Animation
|
||||||
// "[SCENE PRESENCE ANIMATOR]: Setting movement animation {0} for {1}",
|
// "[SCENE PRESENCE ANIMATOR]: Setting movement animation {0} for {1}",
|
||||||
// anim, m_scenePresence.Name);
|
// anim, m_scenePresence.Name);
|
||||||
|
|
||||||
|
if (aoSitGndAnim != UUID.Zero)
|
||||||
|
{
|
||||||
|
avnChangeAnim(aoSitGndAnim, false, false);
|
||||||
|
aoSitGndAnim = UUID.Zero;
|
||||||
|
}
|
||||||
|
|
||||||
UUID overridenAnim = m_scenePresence.Overrides.GetOverriddenAnimation(anim);
|
UUID overridenAnim = m_scenePresence.Overrides.GetOverriddenAnimation(anim);
|
||||||
if (overridenAnim != UUID.Zero)
|
if (overridenAnim != UUID.Zero)
|
||||||
|
{
|
||||||
|
if (anim == "SITGROUND")
|
||||||
|
{
|
||||||
|
UUID defsit = DefaultAvatarAnimations.AnimsUUID["SIT_GROUND_CONSTRAINED"];
|
||||||
|
if (defsit == UUID.Zero)
|
||||||
|
return false;
|
||||||
|
m_animations.SetDefaultAnimation(defsit, m_scenePresence.ControllingClient.NextAnimationSequenceNumber, m_scenePresence.UUID);
|
||||||
|
aoSitGndAnim = overridenAnim;
|
||||||
|
avnChangeAnim(overridenAnim, true, false);
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
m_animations.SetDefaultAnimation(overridenAnim, m_scenePresence.ControllingClient.NextAnimationSequenceNumber, m_scenePresence.UUID);
|
m_animations.SetDefaultAnimation(overridenAnim, m_scenePresence.ControllingClient.NextAnimationSequenceNumber, m_scenePresence.UUID);
|
||||||
|
}
|
||||||
m_scenePresence.SendScriptEventToAttachments("changed", new Object[] { (int)Changed.ANIMATION });
|
m_scenePresence.SendScriptEventToAttachments("changed", new Object[] { (int)Changed.ANIMATION });
|
||||||
SendAnimPack();
|
SendAnimPack();
|
||||||
ret = true;
|
ret = true;
|
||||||
|
|
Loading…
Reference in New Issue