diff options
Diffstat (limited to 'OpenSim/Region/Environment/Scenes')
-rw-r--r-- | OpenSim/Region/Environment/Scenes/ScenePresence.cs | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs index 466b20a..c74cac3 100644 --- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs | |||
@@ -1156,6 +1156,63 @@ namespace OpenSim.Region.Environment.Scenes | |||
1156 | } | 1156 | } |
1157 | } | 1157 | } |
1158 | } | 1158 | } |
1159 | public void AddAnimation(string name) | ||
1160 | { | ||
1161 | if(m_isChildAgent) | ||
1162 | return; | ||
1163 | |||
1164 | // Don't let this animation become the movement animation | ||
1165 | if(m_animations.Count < 1) | ||
1166 | SetMovementAnimation(Animations.AnimsLLUUID["STAND"]); | ||
1167 | |||
1168 | LLUUID animID=m_controllingClient.GetDefaultAnimation(name); | ||
1169 | if(animID == LLUUID.Zero) | ||
1170 | return; | ||
1171 | |||
1172 | if (!m_animations.Contains(animID)) | ||
1173 | { | ||
1174 | m_animations.Add(animID); | ||
1175 | m_animationSeqs.Add(m_controllingClient.NextAnimationSequenceNumber); | ||
1176 | SendAnimPack(); | ||
1177 | } | ||
1178 | } | ||
1179 | |||
1180 | public void RemoveAnimation(string name) | ||
1181 | { | ||
1182 | if(m_isChildAgent) | ||
1183 | return; | ||
1184 | |||
1185 | LLUUID animID=m_controllingClient.GetDefaultAnimation(name); | ||
1186 | if(animID == LLUUID.Zero) | ||
1187 | return; | ||
1188 | |||
1189 | if (m_animations.Contains(animID)) | ||
1190 | { | ||
1191 | if (m_animations[0] == animID) | ||
1192 | { | ||
1193 | SetMovementAnimation(Animations.AnimsLLUUID["STAND"]); | ||
1194 | } | ||
1195 | else | ||
1196 | { | ||
1197 | // What a HACK!! Anim list really needs to be an object! | ||
1198 | int idx; | ||
1199 | |||
1200 | for(idx=0;idx < m_animations.Count;idx++) | ||
1201 | { | ||
1202 | if(m_animations[idx] == animID) | ||
1203 | { | ||
1204 | int seq=m_animationSeqs[idx]; | ||
1205 | |||
1206 | m_animations.Remove(animID); | ||
1207 | m_animationSeqs.Remove(seq); | ||
1208 | SendAnimPack(); | ||
1209 | break; | ||
1210 | } | ||
1211 | } | ||
1212 | } | ||
1213 | } | ||
1214 | } | ||
1215 | |||
1159 | 1216 | ||
1160 | public void HandleStartAnim(IClientAPI remoteClient, LLUUID animID) | 1217 | public void HandleStartAnim(IClientAPI remoteClient, LLUUID animID) |
1161 | { | 1218 | { |