diff options
author | Sergei Litovchuk <slitovchuk@productengine.com> | 2010-02-01 16:57:34 +0200 |
---|---|---|
committer | Sergei Litovchuk <slitovchuk@productengine.com> | 2010-02-01 16:57:34 +0200 |
commit | a359db96eb0273bf67fe48bae2665ea65831cf67 (patch) | |
tree | d3bf44a50882699579073259b88a0cc0a6eb175e /indra/newview/llviewerparcelmgr.cpp | |
parent | 7bcba326b32e1aca678edfb4495d1e2d4d44cb71 (diff) |
(EXT-2987) Parcel Characteristics icons aren't refreshed
after changing restrictions
- LLViewerParcelMgr refactoring. Changed parcel characteristics accessors to get selected parcel properties.
--HG--
branch : product-engine
Diffstat (limited to 'indra/newview/llviewerparcelmgr.cpp')
-rw-r--r-- | indra/newview/llviewerparcelmgr.cpp | 36 |
1 files changed, 21 insertions, 15 deletions
diff --git a/indra/newview/llviewerparcelmgr.cpp b/indra/newview/llviewerparcelmgr.cpp index b85b42c710..7ec650629d 100644 --- a/indra/newview/llviewerparcelmgr.cpp +++ b/indra/newview/llviewerparcelmgr.cpp @@ -666,31 +666,38 @@ bool LLViewerParcelMgr::allowAgentBuild() const } } +// Return whether anyone can build on the given parcel +bool LLViewerParcelMgr::allowAgentBuild(const LLParcel* parcel) const +{ + return parcel->getAllowModify(); +} + bool LLViewerParcelMgr::allowAgentVoice() const { - LLViewerRegion* region = gAgent.getRegion(); + return allowAgentVoice(gAgent.getRegion(), mAgentParcel); +} + +bool LLViewerParcelMgr::allowAgentVoice(const LLViewerRegion* region, const LLParcel* parcel) const +{ return region && region->isVoiceEnabled() - && mAgentParcel && mAgentParcel->getParcelFlagAllowVoice(); + && parcel && parcel->getParcelFlagAllowVoice(); } -bool LLViewerParcelMgr::allowAgentFly() const +bool LLViewerParcelMgr::allowAgentFly(const LLViewerRegion* region, const LLParcel* parcel) const { - LLViewerRegion* region = gAgent.getRegion(); return region && !region->getBlockFly() - && mAgentParcel && mAgentParcel->getAllowFly(); + && parcel && parcel->getAllowFly(); } // Can the agent be pushed around by LLPushObject? -bool LLViewerParcelMgr::allowAgentPush() const +bool LLViewerParcelMgr::allowAgentPush(const LLViewerRegion* region, const LLParcel* parcel) const { - LLViewerRegion* region = gAgent.getRegion(); return region && !region->getRestrictPushObject() - && mAgentParcel && !mAgentParcel->getRestrictPushObject(); + && parcel && !parcel->getRestrictPushObject(); } -bool LLViewerParcelMgr::allowAgentScripts() const +bool LLViewerParcelMgr::allowAgentScripts(const LLViewerRegion* region, const LLParcel* parcel) 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 @@ -698,15 +705,14 @@ bool LLViewerParcelMgr::allowAgentScripts() const return region && !(region->getRegionFlags() & REGION_FLAGS_SKIP_SCRIPTS) && !(region->getRegionFlags() & REGION_FLAGS_ESTATE_SKIP_SCRIPTS) - && mAgentParcel - && mAgentParcel->getAllowOtherScripts(); + && parcel + && parcel->getAllowOtherScripts(); } -bool LLViewerParcelMgr::allowAgentDamage() const +bool LLViewerParcelMgr::allowAgentDamage(const LLViewerRegion* region, const LLParcel* parcel) const { - LLViewerRegion* region = gAgent.getRegion(); return (region && region->getAllowDamage()) - || (mAgentParcel && mAgentParcel->getAllowDamage()); + || (parcel && parcel->getAllowDamage()); } BOOL LLViewerParcelMgr::isOwnedAt(const LLVector3d& pos_global) const |