diff options
Diffstat (limited to 'indra/newview/llviewerparcelmgr.cpp')
-rw-r--r-- | indra/newview/llviewerparcelmgr.cpp | 63 |
1 files changed, 34 insertions, 29 deletions
diff --git a/indra/newview/llviewerparcelmgr.cpp b/indra/newview/llviewerparcelmgr.cpp index b85b42c710..1f6bbcbae8 100644 --- a/indra/newview/llviewerparcelmgr.cpp +++ b/indra/newview/llviewerparcelmgr.cpp @@ -53,7 +53,7 @@ //#include "llfirstuse.h" #include "llfloaterbuyland.h" #include "llfloatergroups.h" -#include "llfloaternearbymedia.h" +#include "llpanelnearbymedia.h" #include "llfloatersellland.h" #include "llfloatertools.h" #include "llparcelselection.h" @@ -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()) { @@ -1791,12 +1795,13 @@ void optionally_start_music(const std::string& music_url) { // only play music when you enter a new parcel if the UI control for this // was not *explicitly* stopped by the user. (part of SL-4878) - LLFloaterNearbyMedia *nearby_media_floater = LLFloaterReg::findTypedInstance<LLFloaterNearbyMedia>("nearby_media"); - if ((nearby_media_floater && - nearby_media_floater->getParcelAudioAutoStart()) || + LLPanelNearByMedia* nearby_media_panel = gStatusBar->getNearbyMediaPanel();; + if ((nearby_media_panel && + nearby_media_panel->getParcelAudioAutoStart()) || // or they have expressed no opinion in the UI, but have autoplay on... - (!nearby_media_floater && - gSavedSettings.getBOOL(LLViewerMedia::AUTO_PLAY_MEDIA_SETTING))) + (!nearby_media_panel && + gSavedSettings.getBOOL(LLViewerMedia::AUTO_PLAY_MEDIA_SETTING) && + gSavedSettings.getBOOL("MediaTentativeAutoPlay"))) { llinfos << "Starting parcel music " << music_url << llendl; gAudiop->startInternetStream(music_url); |