diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index 6cb4e57e73..27dd6334d0 100644 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -408,6 +408,7 @@ LLAgent::LLAgent() : mIsAutorespond(FALSE), mIsAutorespondNonFriends(FALSE), mIsRejectTeleportOffers(FALSE), // FIRE-1245: Option to block/reject teleport offers + mAfkSitting(false), // FIRE-1568: Fix sit on AFK issues (standing up when sitting before) mControlFlags(0x00000000), mbFlagsDirty(FALSE), @@ -1582,6 +1583,7 @@ void LLAgent::setAFK() if (!gAgentAvatarp->isSitting() && !gRlvHandler.hasBehaviour(RLV_BHVR_SIT)) { gAgent.sitDown(); + gAgent.setIsAfkSitting(true); } } // @@ -1607,13 +1609,16 @@ void LLAgent::clearAFK() // if we sat while away, stand back up on clear if (gSavedSettings.getBOOL("AvatarSitOnAway")) { - if (gAgentAvatarp->isSitting() && !gRlvHandler.hasBehaviour(RLV_BHVR_UNSIT)) + if (gAgent.isAfkSitting() && !gRlvHandler.hasBehaviour(RLV_BHVR_UNSIT)) { gAgent.standUp(); } } // } + + // FIRE-1568: Fix sit on AFK issues (standing up when sitting before) + gAgent.setIsAfkSitting(false); } //----------------------------------------------------------------------------- diff --git a/indra/newview/llagent.h b/indra/newview/llagent.h index cde89ee0aa..b1cd906f15 100755 --- a/indra/newview/llagent.h +++ b/indra/newview/llagent.h @@ -442,6 +442,14 @@ public: /// @brief ground-sit at agent's current position void sitDown(); + // FIRE-1568: Fix sit on AFK issues (standing up when sitting before) + void setIsAfkSitting(bool sitting) { mAfkSitting = sitting; } + bool isAfkSitting() const { return mAfkSitting; } + +private: + bool mAfkSitting; + // + //-------------------------------------------------------------------- // Do Not Disturb //--------------------------------------------------------------------