summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indra/newview/llagent.cpp6
-rw-r--r--indra/newview/llagent.h3
-rw-r--r--indra/newview/llviewermenu.cpp2
-rw-r--r--indra/newview/rlvhandler.cpp7
-rw-r--r--indra/newview/rlvhelper.cpp1
5 files changed, 15 insertions, 4 deletions
diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp
index b8b5ba2264..3a4e29afc1 100644
--- a/indra/newview/llagent.cpp
+++ b/indra/newview/llagent.cpp
@@ -387,6 +387,7 @@ LLAgent::LLAgent() :
mbTeleportKeepsLookAt(false),
mAllowedToStand(true),
+ mAllowedToSit(true),
mAgentAccess(new LLAgentAccess(gSavedSettings)),
mGodLevelChangeSignal(),
@@ -971,8 +972,7 @@ bool LLAgent::isSitting()
void LLAgent::standUp()
{
- if (mAllowedToStand)
- setControlFlags(AGENT_CONTROL_STAND_UP);
+ if (mAllowedToStand) setControlFlags(AGENT_CONTROL_STAND_UP);
}
void LLAgent::changeParcels()
@@ -1346,7 +1346,7 @@ LLVector3d LLAgent::getPosGlobalFromAgent(const LLVector3 &pos_agent) const
void LLAgent::sitDown()
{
- setControlFlags(AGENT_CONTROL_SIT_ON_GROUND);
+ if (mAllowedToSit) setControlFlags(AGENT_CONTROL_SIT_ON_GROUND);
}
diff --git a/indra/newview/llagent.h b/indra/newview/llagent.h
index 74d8719047..ca8aaaee86 100644
--- a/indra/newview/llagent.h
+++ b/indra/newview/llagent.h
@@ -448,8 +448,11 @@ public:
void sitDown();
bool isAllowedToStand() const { return mAllowedToStand; }
void setAllowedToStand(bool allow) { mAllowedToStand = allow; }
+ bool isAllowedToSit() const { return mAllowedToSit; }
+ void setAllowedToSit(bool allow) { mAllowedToSit = allow; }
private:
bool mAllowedToStand;
+ bool mAllowedToSit;
//--------------------------------------------------------------------
// Do Not Disturb
diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp
index 63527d8594..cb2a8a54b7 100644
--- a/indra/newview/llviewermenu.cpp
+++ b/indra/newview/llviewermenu.cpp
@@ -4506,7 +4506,7 @@ void handle_object_sit(LLViewerObject* object, const LLVector3& offset)
{
// get object selection offset
- if (object && object->getPCode() == LL_PCODE_VOLUME)
+ if (gAgent.isAllowedToSit() && object && object->getPCode() == LL_PCODE_VOLUME)
{
gMessageSystem->newMessageFast(_PREHASH_AgentRequestSit);
diff --git a/indra/newview/rlvhandler.cpp b/indra/newview/rlvhandler.cpp
index 01f5d28ced..dce1471100 100644
--- a/indra/newview/rlvhandler.cpp
+++ b/indra/newview/rlvhandler.cpp
@@ -269,6 +269,13 @@ ECmdRet CommandHandlerBaseImpl<EParamType::AddRem>::processCommand(const RlvComm
}
template<> template<>
+ECmdRet BehaviourToggleHandler<EBehaviour::Sit>::onCommand(const RlvCommand& rlvCmd, bool& toggle)
+{
+ gAgent.setAllowedToSit(toggle);
+ return ECmdRet::Succeeded;
+}
+
+template<> template<>
ECmdRet BehaviourToggleHandler<EBehaviour::Unsit>::onCommand(const RlvCommand& rlvCmd, bool& toggle)
{
gAgent.setAllowedToStand(toggle);
diff --git a/indra/newview/rlvhelper.cpp b/indra/newview/rlvhelper.cpp
index 7c5f939d31..f26b5a115f 100644
--- a/indra/newview/rlvhelper.cpp
+++ b/indra/newview/rlvhelper.cpp
@@ -60,6 +60,7 @@ BehaviourDictionary::BehaviourDictionary()
addEntry(new ForceProcessor<EBehaviour::Unsit>("unsit"));
// AddRem
+ addEntry(new BehaviourProcessor<EBehaviour::Sit>("sit"));
addEntry(new BehaviourProcessor<EBehaviour::Unsit>("unsit"));
// Populate mString2InfoMap (the tuple <behaviour, type> should be unique)