diff options
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 |