aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llagent.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/newview/llagent.cpp')
-rw-r--r--linden/indra/newview/llagent.cpp51
1 files changed, 41 insertions, 10 deletions
diff --git a/linden/indra/newview/llagent.cpp b/linden/indra/newview/llagent.cpp
index d268397..21de6a3 100644
--- a/linden/indra/newview/llagent.cpp
+++ b/linden/indra/newview/llagent.cpp
@@ -5750,18 +5750,13 @@ bool LLAgent::teleportCore(bool is_local)
5750 return false; 5750 return false;
5751 } 5751 }
5752 5752
5753 // Stop all animation before actual teleporting 5753 // Cease sitting on the current object, if any.
5754 LLVOAvatar* avatarp = gAgent.getAvatarObject(); 5754 LLVOAvatar* avatarp = gAgent.getAvatarObject();
5755 if (avatarp) 5755 if (avatarp)
5756 { 5756 avatarp->getOffObject();
5757 for ( LLVOAvatar::AnimIterator anim_it= avatarp->mPlayingAnimations.begin() 5757
5758 ; anim_it != avatarp->mPlayingAnimations.end() 5758 // Stop all animations before actual teleporting
5759 ; anim_it++) 5759 stopCurrentAnimations();
5760 {
5761 avatarp->stopMotion(anim_it->first);
5762 }
5763 avatarp->processAnimationStateChanges();
5764 }
5765 5760
5766 // Don't call LLFirstUse::useTeleport because we don't know 5761 // Don't call LLFirstUse::useTeleport because we don't know
5767 // yet if the teleport will succeed. Look in 5762 // yet if the teleport will succeed. Look in
@@ -5940,6 +5935,42 @@ void LLAgent::setTeleportState(ETeleportState state)
5940 } 5935 }
5941} 5936}
5942 5937
5938void LLAgent::stopCurrentAnimations()
5939{
5940 // This function stops all current overriding animations on this
5941 // avatar, propagating this change back to the server.
5942
5943 LLVOAvatar* avatarp = gAgent.getAvatarObject();
5944 if (avatarp)
5945 {
5946 for ( LLVOAvatar::AnimIterator anim_it =
5947 avatarp->mPlayingAnimations.begin();
5948 anim_it != avatarp->mPlayingAnimations.end();
5949 anim_it++)
5950 {
5951 if (anim_it->first ==
5952 ANIM_AGENT_SIT_GROUND_CONSTRAINED)
5953 {
5954 // don't cancel a ground-sit anim, as viewers
5955 // use this animation's status in
5956 // determining whether we're sitting. ick.
5957 }
5958 else
5959 {
5960 // stop this animation locally
5961 avatarp->stopMotion(anim_it->first, TRUE);
5962 // ...and tell the server to tell everyone.
5963 sendAnimationRequest(anim_it->first, ANIM_REQUEST_STOP);
5964 }
5965 }
5966
5967 // re-assert at least the default standing animation, because
5968 // viewers get confused by avs with no associated anims.
5969 sendAnimationRequest(ANIM_AGENT_STAND,
5970 ANIM_REQUEST_START);
5971 }
5972}
5973
5943void LLAgent::fidget() 5974void LLAgent::fidget()
5944{ 5975{
5945 if (!getAFK()) 5976 if (!getAFK())