From e8adc1d008fbe704798f3b5820fca38ba9abeb48 Mon Sep 17 00:00:00 2001
From: Mnikolenko ProductEngine <mnikolenko@productengine.com>
Date: Tue, 26 Aug 2014 11:53:57 +0300
Subject: [PATCH] MAINT-4322 FIXED Re-assert DND tag animation if it was
 cancelled by script, when DND mode is still active

---
 indra/newview/llagent.cpp    | 4 ++--
 indra/newview/llvoavatar.cpp | 6 ++++++
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp
index e5a90e8a281..ef1d528aa2b 100755
--- a/indra/newview/llagent.cpp
+++ b/indra/newview/llagent.cpp
@@ -4116,8 +4116,8 @@ void LLAgent::stopCurrentAnimations()
 		      anim_it != gAgentAvatarp->mPlayingAnimations.end();
 		      anim_it++)
 		{
-			if (anim_it->first ==
-			    ANIM_AGENT_SIT_GROUND_CONSTRAINED)
+			if ((anim_it->first == ANIM_AGENT_DO_NOT_DISTURB)||
+				(anim_it->first == ANIM_AGENT_SIT_GROUND_CONSTRAINED))
 			{
 				// don't cancel a ground-sit anim, as viewers
 				// use this animation's status in
diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp
index 22b979aa098..d6c03b68883 100755
--- a/indra/newview/llvoavatar.cpp
+++ b/indra/newview/llvoavatar.cpp
@@ -4884,6 +4884,12 @@ BOOL LLVOAvatar::processSingleAnimationStateChange( const LLUUID& anim_id, BOOL
 		{
 			sitDown(FALSE);
 		}
+		if ((anim_id == ANIM_AGENT_DO_NOT_DISTURB) && gAgent.isDoNotDisturb())
+		{
+			// re-assert DND tag animation
+			gAgent.sendAnimationRequest(ANIM_AGENT_DO_NOT_DISTURB, ANIM_REQUEST_START);
+			return result;
+		}
 		stopMotion(anim_id);
 		result = TRUE;
 	}
-- 
GitLab