diff options
author | Palmer Truelson <palmer@lindenlab.com> | 2009-11-25 09:42:58 -0800 |
---|---|---|
committer | Palmer Truelson <palmer@lindenlab.com> | 2009-11-25 09:42:58 -0800 |
commit | bb614fa887ec7cadc5b370c1dcf412ae5cf662e1 (patch) | |
tree | 2ee594428704e0f4774f717d71485ee0bdde8748 /indra/newview/llviewerparcelmgr.cpp | |
parent | 6d66910c6e2fbb25bf8b5c7b90e795f350342104 (diff) | |
parent | 57bc7dc44f31ef132a4abec228459c490c425eed (diff) |
Merge of viewer 2
Diffstat (limited to 'indra/newview/llviewerparcelmgr.cpp')
-rw-r--r-- | indra/newview/llviewerparcelmgr.cpp | 42 |
1 files changed, 35 insertions, 7 deletions
diff --git a/indra/newview/llviewerparcelmgr.cpp b/indra/newview/llviewerparcelmgr.cpp index aa0987aa7d..fcaf49c884 100644 --- a/indra/newview/llviewerparcelmgr.cpp +++ b/indra/newview/llviewerparcelmgr.cpp @@ -650,7 +650,7 @@ LLParcel *LLViewerParcelMgr::getAgentParcel() const } // Return whether the agent can build on the land they are on -bool LLViewerParcelMgr::agentCanBuild() const +bool LLViewerParcelMgr::allowAgentBuild() const { if (mAgentParcel) { @@ -664,19 +664,47 @@ bool LLViewerParcelMgr::agentCanBuild() const } } -BOOL LLViewerParcelMgr::agentCanTakeDamage() const +bool LLViewerParcelMgr::allowAgentVoice() const { - return mAgentParcel->getAllowDamage(); + LLViewerRegion* region = gAgent.getRegion(); + return region && region->isVoiceEnabled() + && mAgentParcel && mAgentParcel->getParcelFlagAllowVoice(); } -BOOL LLViewerParcelMgr::agentCanFly() const +bool LLViewerParcelMgr::allowAgentFly() const { - return TRUE; + LLViewerRegion* region = gAgent.getRegion(); + return region && !region->getBlockFly() + && mAgentParcel && mAgentParcel->getAllowFly(); } -F32 LLViewerParcelMgr::agentDrawDistance() const +// Can the agent be pushed around by LLPushObject? +bool LLViewerParcelMgr::allowAgentPush() const { - return 512.f; + LLViewerRegion* region = gAgent.getRegion(); + return region && !region->getRestrictPushObject() + && mAgentParcel && !mAgentParcel->getRestrictPushObject(); +} + +bool LLViewerParcelMgr::allowAgentScripts() const +{ + LLViewerRegion* region = gAgent.getRegion(); + // *NOTE: This code does not take into account group-owned parcels + // and the flag to allow group-owned scripted objects to run. + // This mirrors the traditional menu bar parcel icon code, but is not + // technically correct. + return region + && !(region->getRegionFlags() & REGION_FLAGS_SKIP_SCRIPTS) + && !(region->getRegionFlags() & REGION_FLAGS_ESTATE_SKIP_SCRIPTS) + && mAgentParcel + && mAgentParcel->getAllowOtherScripts(); +} + +bool LLViewerParcelMgr::allowAgentDamage() const +{ + LLViewerRegion* region = gAgent.getRegion(); + return region && region->getAllowDamage() + && mAgentParcel && mAgentParcel->getAllowDamage(); } BOOL LLViewerParcelMgr::isOwnedAt(const LLVector3d& pos_global) const |