From 00abcf5bb6e945632a5450663d7e55e1c63a466a Mon Sep 17 00:00:00 2001 From: elektrahesse Date: Sun, 3 Oct 2010 10:06:37 +0200 Subject: Patch to enable building on any parcel if the agent has create powers in the land group. If the land is deeded the object is created with the agent active group, else it's set to the land group by default. Also enables the build button when it should. --- linden/indra/newview/lltoolplacer.cpp | 13 ++++++++++--- linden/indra/newview/llviewerparcelmgr.cpp | 22 ++++++++++++++-------- 2 files changed, 24 insertions(+), 11 deletions(-) diff --git a/linden/indra/newview/lltoolplacer.cpp b/linden/indra/newview/lltoolplacer.cpp index d5c4de1..00b0c9f 100644 --- a/linden/indra/newview/lltoolplacer.cpp +++ b/linden/indra/newview/lltoolplacer.cpp @@ -67,6 +67,7 @@ #include "llparcel.h" // RezWithLandGroup #include "llviewerparcelmgr.h" // RezWithLandGroup +#include "roles_constants.h" // Ele: Land Group Override const LLVector3 DEFAULT_OBJECT_SCALE(0.5f, 0.5f, 0.5f); @@ -264,9 +265,11 @@ BOOL LLToolPlacer::addObject( LLPCode pcode, S32 x, S32 y, U8 use_physics ) gMessageSystem->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); // RezWithLandGroup 2009-05, If avatar is in land group/land owner group, // it rezzes it with it to prevent autoreturn/whatever - if ( gSavedSettings.getBOOL("RezWithLandGroup") ) + + // Ele: if agent is in land group and has create powers but the tag is not active, force it to enable build seamlessly + LLParcel *parcel = LLViewerParcelMgr::getInstance()->getAgentParcel(); + if ( gSavedSettings.getBOOL("RezWithLandGroup")) { - LLParcel *parcel = LLViewerParcelMgr::getInstance()->getAgentParcel(); if ( gAgent.isInGroup(parcel->getGroupID()) ) { gMessageSystem->addUUIDFast(_PREHASH_GroupID, parcel->getGroupID()); @@ -280,7 +283,11 @@ BOOL LLToolPlacer::addObject( LLPCode pcode, S32 x, S32 y, U8 use_physics ) gMessageSystem->addUUIDFast(_PREHASH_GroupID, gAgent.getGroupID()); } } - else + else if (gAgent.hasPowerInGroup(parcel->getGroupID(), GP_LAND_ALLOW_CREATE) && !parcel->getIsGroupOwned()) + { + gMessageSystem->addUUIDFast(_PREHASH_GroupID, parcel->getGroupID()); + } + else { gMessageSystem->addUUIDFast(_PREHASH_GroupID, gAgent.getGroupID()); } diff --git a/linden/indra/newview/llviewerparcelmgr.cpp b/linden/indra/newview/llviewerparcelmgr.cpp index 61b91fe..257ce0d 100644 --- a/linden/indra/newview/llviewerparcelmgr.cpp +++ b/linden/indra/newview/llviewerparcelmgr.cpp @@ -651,15 +651,21 @@ BOOL LLViewerParcelMgr::agentCanBuild() const { if (mAgentParcel) { - return (gAgent.isGodlike() - || (mAgentParcel->allowModifyBy( - gAgent.getID(), - gAgent.getGroupID()))); - } - else - { - return gAgent.isGodlike(); + const LLUUID parcel_group = mAgentParcel->getGroupID(); + const LLUUID active_group = gAgent.getGroupID(); + + if (gAgent.isGodlike()) + return true; + + if (mAgentParcel->allowModifyBy(gAgent.getID(), active_group)) + return true; + + // Ele: enable build option if we are in the land group and we have create powers, even if the group tag is not active + if (gAgent.isInGroup(parcel_group) && gAgent.hasPowerInGroup(parcel_group, GP_LAND_ALLOW_CREATE)) + return true; } + + return gAgent.isGodlike(); } BOOL LLViewerParcelMgr::agentCanTakeDamage() const -- cgit v1.1