summaryrefslogtreecommitdiff
path: root/indra/newview/llagent.cpp
diff options
context:
space:
mode:
authorDave Parks <davep@lindenlab.com>2013-06-21 12:51:29 -0500
committerDave Parks <davep@lindenlab.com>2013-06-21 12:51:29 -0500
commit79029149a415a9f32e08d378653199a880d21e65 (patch)
tree14b6f7d59c66602affd77b6e21f1981b28995fa8 /indra/newview/llagent.cpp
parent80552a465e9169b7326c346f4685790ea459823a (diff)
parent8511385a5407181ced7bb226d4054185c597d05e (diff)
Automated merge with file:///F:%5Cviewer-bear
Diffstat (limited to 'indra/newview/llagent.cpp')
-rwxr-xr-xindra/newview/llagent.cpp33
1 files changed, 32 insertions, 1 deletions
diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp
index 3e94c5edf7..1a96699cff 100755
--- a/indra/newview/llagent.cpp
+++ b/indra/newview/llagent.cpp
@@ -3048,6 +3048,30 @@ void LLAgent::sendAnimationRequest(const LLUUID &anim_id, EAnimRequest request)
sendReliableMessage();
}
+// Send a message to the region to stop the NULL animation state
+// This will reset animation state overrides for the agent.
+void LLAgent::sendAnimationStateReset()
+{
+ if (gAgentID.isNull() || !mRegionp)
+ {
+ return;
+ }
+
+ LLMessageSystem* msg = gMessageSystem;
+ msg->newMessageFast(_PREHASH_AgentAnimation);
+ msg->nextBlockFast(_PREHASH_AgentData);
+ msg->addUUIDFast(_PREHASH_AgentID, getID());
+ msg->addUUIDFast(_PREHASH_SessionID, getSessionID());
+
+ msg->nextBlockFast(_PREHASH_AnimationList);
+ msg->addUUIDFast(_PREHASH_AnimID, LLUUID::null );
+ msg->addBOOLFast(_PREHASH_StartAnim, FALSE);
+
+ msg->nextBlockFast(_PREHASH_PhysicalAvatarEventList);
+ msg->addBinaryDataFast(_PREHASH_TypeData, NULL, 0);
+ sendReliableMessage();
+}
+
void LLAgent::sendWalkRun(bool running)
{
LLMessageSystem* msgsys = gMessageSystem;
@@ -4126,6 +4150,8 @@ void LLAgent::stopCurrentAnimations()
// avatar, propagating this change back to the server.
if (isAgentAvatarValid())
{
+ LLDynamicArray<LLUUID> anim_ids;
+
for ( LLVOAvatar::AnimIterator anim_it =
gAgentAvatarp->mPlayingAnimations.begin();
anim_it != gAgentAvatarp->mPlayingAnimations.end();
@@ -4143,10 +4169,15 @@ void LLAgent::stopCurrentAnimations()
// stop this animation locally
gAgentAvatarp->stopMotion(anim_it->first, TRUE);
// ...and tell the server to tell everyone.
- sendAnimationRequest(anim_it->first, ANIM_REQUEST_STOP);
+ anim_ids.push_back(anim_it->first);
}
}
+ sendAnimationRequests(anim_ids, ANIM_REQUEST_STOP);
+
+ // Tell the region to clear any animation state overrides.
+ sendAnimationStateReset();
+
// re-assert at least the default standing animation, because
// viewers get confused by avs with no associated anims.
sendAnimationRequest(ANIM_AGENT_STAND,