Respect always rez under owned land group setting for objects

duplicated by shift-dragging or duplicating.

Based on Phoenix changeset 5b50018c63d4 by Kadah
This commit is contained in:
Latif Khalifa
2013-01-23 12:02:04 +01:00
parent d8c846288e
commit 5e799b1f81

View File

@@ -86,6 +86,9 @@
#include "pipeline.h"
#include "llviewershadermgr.h"
#include "llparcel.h"
#include "llviewerparcelmgr.h"
#include "llglheaders.h"
#include "hippogridmanager.h"
@@ -3735,7 +3738,24 @@ void LLSelectMgr::packDuplicateOnRayHead(void *user_data)
msg->nextBlockFast(_PREHASH_AgentData);
msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID() );
msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID() );
msg->addUUIDFast(_PREHASH_GroupID, gAgent.getGroupID() );
LLUUID group_id = gAgent.getGroupID();
// Apply always rez under owned land group setting for objects
// duplicated by shift-dragging or duplicating
if (gSavedSettings.getBOOL("AscentAlwaysRezInGroup"))
{
LLParcel *parcel = LLViewerParcelMgr::getInstance()->getAgentParcel();
if (gAgent.isInGroup(parcel->getGroupID()))
{
group_id = parcel->getGroupID();
}
else if (gAgent.isInGroup(parcel->getOwnerID()))
{
group_id = parcel->getOwnerID();
}
}
msg->addUUIDFast(_PREHASH_GroupID, group_id);
msg->addVector3Fast(_PREHASH_RayStart, data->mRayStartRegion );
msg->addVector3Fast(_PREHASH_RayEnd, data->mRayEndRegion );
msg->addBOOLFast(_PREHASH_BypassRaycast, data->mBypassRaycast );
@@ -4553,6 +4573,22 @@ void LLSelectMgr::packAgentAndSessionAndGroupID(void* user_data)
void LLSelectMgr::packDuplicateHeader(void* data)
{
LLUUID group_id(gAgent.getGroupID());
// Apply always rez under owned land group setting for objects
// duplicated by shift-dragging or duplicating
if (gSavedSettings.getBOOL("AscentAlwaysRezInGroup"))
{
LLParcel *parcel = LLViewerParcelMgr::getInstance()->getAgentParcel();
if (gAgent.isInGroup(parcel->getGroupID()))
{
group_id = parcel->getGroupID();
}
else if (gAgent.isInGroup(parcel->getOwnerID()))
{
group_id = parcel->getOwnerID();
}
}
packAgentAndSessionAndGroupID(&group_id);
LLDuplicateData* dup_data = (LLDuplicateData*) data;