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 6fe4863..89ba09c 100644
--- a/linden/indra/newview/llagent.cpp
+++ b/linden/indra/newview/llagent.cpp
@@ -5822,18 +5822,13 @@ bool LLAgent::teleportCore(bool is_local)
5822 return false; 5822 return false;
5823 } 5823 }
5824 5824
5825 // Stop all animation before actual teleporting 5825 // Cease sitting on the current object, if any.
5826 LLVOAvatar* avatarp = gAgent.getAvatarObject(); 5826 LLVOAvatar* avatarp = gAgent.getAvatarObject();
5827 if (avatarp) 5827 if (avatarp)
5828 { 5828 avatarp->getOffObject();
5829 for ( LLVOAvatar::AnimIterator anim_it= avatarp->mPlayingAnimations.begin() 5829
5830 ; anim_it != avatarp->mPlayingAnimations.end() 5830 // Stop all animations before actual teleporting
5831 ; anim_it++) 5831 stopCurrentAnimations();
5832 {
5833 avatarp->stopMotion(anim_it->first);
5834 }
5835 avatarp->processAnimationStateChanges();
5836 }
5837 5832
5838 // Don't call LLFirstUse::useTeleport because we don't know 5833 // Don't call LLFirstUse::useTeleport because we don't know
5839 // yet if the teleport will succeed. Look in 5834 // yet if the teleport will succeed. Look in
@@ -6034,6 +6029,42 @@ void LLAgent::setTeleportState(ETeleportState state)
6034 } 6029 }
6035} 6030}
6036 6031
6032void LLAgent::stopCurrentAnimations()
6033{
6034 // This function stops all current overriding animations on this
6035 // avatar, propagating this change back to the server.
6036
6037 LLVOAvatar* avatarp = gAgent.getAvatarObject();
6038 if (avatarp)
6039 {
6040 for ( LLVOAvatar::AnimIterator anim_it =
6041 avatarp->mPlayingAnimations.begin();
6042 anim_it != avatarp->mPlayingAnimations.end();
6043 anim_it++)
6044 {
6045 if (anim_it->first ==
6046 ANIM_AGENT_SIT_GROUND_CONSTRAINED)
6047 {
6048 // don't cancel a ground-sit anim, as viewers
6049 // use this animation's status in
6050 // determining whether we're sitting. ick.
6051 }
6052 else
6053 {
6054 // stop this animation locally
6055 avatarp->stopMotion(anim_it->first, TRUE);
6056 // ...and tell the server to tell everyone.
6057 sendAnimationRequest(anim_it->first, ANIM_REQUEST_STOP);
6058 }
6059 }
6060
6061 // re-assert at least the default standing animation, because
6062 // viewers get confused by avs with no associated anims.
6063 sendAnimationRequest(ANIM_AGENT_STAND,
6064 ANIM_REQUEST_START);
6065 }
6066}
6067
6037void LLAgent::fidget() 6068void LLAgent::fidget()
6038{ 6069{
6039 if (!getAFK()) 6070 if (!getAFK())