diff --git a/indra/newview/rlvhandler.cpp b/indra/newview/rlvhandler.cpp index ba136231fb95364f7d104ee8873c2488e0e8ae35..f690ea0b8267089ec643662dc0eb417ca1c06a15 100644 --- a/indra/newview/rlvhandler.cpp +++ b/indra/newview/rlvhandler.cpp @@ -887,10 +887,7 @@ void RlvHandler::setCameraOverride(bool fOverride) // Checked: 2010-08-29 (RLVa-1.2.1c) | Modified: RLVa-1.2.1c void RlvHandler::onSitOrStand(bool fSitting) { - if (rlv_handler_t::isEnabled()) - { - RlvSettings::updateLoginLastLocation(); - } + RlvSettings::updateLoginLastLocation(); if ( (hasBehaviour(RLV_BHVR_STANDTP)) && (!fSitting) && (!m_posSitSource.isExactlyZero()) ) { @@ -908,6 +905,16 @@ void RlvHandler::onSitOrStand(bool fSitting) gAgent.setControlFlags(AGENT_CONTROL_SIT_ON_GROUND); send_agent_update(TRUE, TRUE); } + + if (isAgentAvatarValid()) + { + const LLViewerObject* pSitObj = static_cast<const LLViewerObject*>(gAgentAvatarp->getParent()); + const LLUUID& idSitObj = (pSitObj) ? pSitObj->getID() : LLUUID::null; + if (fSitting) + RlvBehaviourNotifyHandler::instance().onSit(idSitObj, true /* Apparently we shouldn't track legal vs 'illegal' (ground) sits */); + else + RlvBehaviourNotifyHandler::instance().onStand(idSitObj, !gRlvHandler.hasBehaviourExcept(RLV_BHVR_UNSIT, getCurrentObject())); + } } // Checked: 2010-03-11 (RLVa-1.2.0a) | Modified: RLVa-1.2.0a diff --git a/indra/newview/rlvhelper.cpp b/indra/newview/rlvhelper.cpp index 207ca5cebd410ba5a7b701b28a50cb7d22513614..bd9b0d6a9ad2aca5c5bcee34a59be45d948315f3 100644 --- a/indra/newview/rlvhelper.cpp +++ b/indra/newview/rlvhelper.cpp @@ -1920,6 +1920,22 @@ void RlvBehaviourNotifyHandler::onReattach(const LLViewerJointAttachment* pAttac sendNotification(llformat("reattached %s %s", (fAllowed) ? "legally" : "illegally", pAttachPt->getName().c_str())); } +void RlvBehaviourNotifyHandler::onSit(const LLUUID& idObj, bool fAllowed) +{ + if (idObj.isNull()) + sendNotification(llformat("sat ground %s", (fAllowed) ? "legally" : "illegally")); + else + sendNotification(llformat("sat object %s %s", (fAllowed) ? "legally" : "illegally", idObj.asString().c_str())); +} + +void RlvBehaviourNotifyHandler::onStand(const LLUUID& idObj, bool fAllowed) +{ + if (idObj.isNull()) + sendNotification(llformat("unsat ground %s", (fAllowed) ? "legally" : "illegally")); + else + sendNotification(llformat("unsat object %s %s", (fAllowed) ? "legally" : "illegally", idObj.asString().c_str())); +} + // ========================================================================= // Various helper classes/timers/functors // diff --git a/indra/newview/rlvhelper.h b/indra/newview/rlvhelper.h index 9a561bfcfb5057beacb0d9a0321efe11ffa2329a..f150d9f191d77d17cd489a0d4a340b83f3fcb485 100644 --- a/indra/newview/rlvhelper.h +++ b/indra/newview/rlvhelper.h @@ -633,6 +633,8 @@ class RlvBehaviourNotifyHandler : public LLSingleton<RlvBehaviourNotifyHandler> static void onAttach(const LLViewerJointAttachment* pAttachPt, bool fAllowed); static void onDetach(const LLViewerJointAttachment* pAttachPt, bool fAllowed); static void onReattach(const LLViewerJointAttachment* pAttachPt, bool fAllowed); + void onSit(const LLUUID& idObj, bool fAllowed); + void onStand(const LLUUID& idObj, bool fAllowed); protected: void onCommand(const RlvCommand& rlvCmd, ERlvCmdRet eRet, bool fInternal);