summaryrefslogtreecommitdiff
path: root/indra/newview/llagent.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llagent.cpp')
-rw-r--r--indra/newview/llagent.cpp56
1 files changed, 46 insertions, 10 deletions
diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp
index ab2f06ef53..7eca956f7d 100644
--- a/indra/newview/llagent.cpp
+++ b/indra/newview/llagent.cpp
@@ -5830,18 +5830,18 @@ bool LLAgent::teleportCore(bool is_local)
return false;
}
- // Stop all animation before actual teleporting
+ // Stop all animation before actual teleporting
LLVOAvatar* avatarp = gAgent.getAvatarObject();
- if (avatarp)
+ if (avatarp)
{
- for ( LLVOAvatar::AnimIterator anim_it= avatarp->mPlayingAnimations.begin()
- ; anim_it != avatarp->mPlayingAnimations.end()
- ; anim_it++)
- {
- avatarp->stopMotion(anim_it->first);
- }
- avatarp->processAnimationStateChanges();
- }
+ for ( LLVOAvatar::AnimIterator anim_it= avatarp->mPlayingAnimations.begin();
+ anim_it != avatarp->mPlayingAnimations.end();
+ ++anim_it)
+ {
+ avatarp->stopMotion(anim_it->first);
+ }
+ avatarp->processAnimationStateChanges();
+ }
// Don't call LLFirstUse::useTeleport because we don't know
// yet if the teleport will succeed. Look in
@@ -6020,6 +6020,42 @@ void LLAgent::setTeleportState(ETeleportState state)
}
}
+void LLAgent::stopCurrentAnimations()
+{
+ // This function stops all current overriding animations on this
+ // avatar, propagating this change back to the server.
+
+ LLVOAvatar* avatarp = gAgent.getAvatarObject();
+ if (avatarp)
+ {
+ for ( LLVOAvatar::AnimIterator anim_it =
+ avatarp->mPlayingAnimations.begin();
+ anim_it != avatarp->mPlayingAnimations.end();
+ anim_it++)
+ {
+ if (anim_it->first ==
+ ANIM_AGENT_SIT_GROUND_CONSTRAINED)
+ {
+ // don't cancel a ground-sit anim, as viewers
+ // use this animation's status in
+ // determining whether we're sitting. ick.
+ }
+ else
+ {
+ // stop this animation locally
+ avatarp->stopMotion(anim_it->first, TRUE);
+ // ...and tell the server to tell everyone.
+ sendAnimationRequest(anim_it->first, ANIM_REQUEST_STOP);
+ }
+ }
+
+ // re-assert at least the default standing animation, because
+ // viewers get confused by avs with no associated anims.
+ sendAnimationRequest(ANIM_AGENT_STAND,
+ ANIM_REQUEST_START);
+ }
+}
+
void LLAgent::fidget()
{
if (!getAFK())