diff options
author | Justin Clark-Casey (justincc) | 2013-01-18 22:57:09 +0000 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2013-01-25 23:54:53 +0000 |
commit | af5a3f2d7392ce6f86ef210c401956ca92cdb8e2 (patch) | |
tree | 973e46d4dd45814ac7737617b9bc94e5e1aece7f /OpenSim/Region/Framework | |
parent | Check the existing ScenePresence.ParentPart to make sure we're not trying to ... (diff) | |
download | opensim-SC-af5a3f2d7392ce6f86ef210c401956ca92cdb8e2.zip opensim-SC-af5a3f2d7392ce6f86ef210c401956ca92cdb8e2.tar.gz opensim-SC-af5a3f2d7392ce6f86ef210c401956ca92cdb8e2.tar.bz2 opensim-SC-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/Framework')
3 files changed, 25 insertions, 6 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> |