summaryrefslogtreecommitdiff
path: root/indra/newview/llviewerparcelmgr.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llviewerparcelmgr.cpp')
-rw-r--r--indra/newview/llviewerparcelmgr.cpp50
1 files changed, 27 insertions, 23 deletions
diff --git a/indra/newview/llviewerparcelmgr.cpp b/indra/newview/llviewerparcelmgr.cpp
index b85b42c710..07c8867e26 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
@@ -1591,14 +1597,6 @@ void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **use
instance->mTeleportInProgress = FALSE;
instance->mTeleportFinishedSignal(gAgent.getPositionGlobal());
}
-
- // HACK: This makes agents drop from the sky if they enter a parcel
- // which is set to no fly.
- BOOL was_flying = gAgent.getFlying();
- if (was_flying && !parcel->getAllowFly())
- {
- gAgent.setFlying(gAgent.canFly());
- }
}
}
@@ -1764,6 +1762,12 @@ void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **use
{
optionally_start_music(music_url);
}
+ else
+ {
+ llinfos << "Stopping parcel music (invalid audio stream URL)" << llendl;
+ // clears the URL
+ gAudiop->startInternetStream(LLStringUtil::null);
+ }
}
else if (!gAudiop->getInternetStreamURL().empty())
{