* refactor: Convert most non SOP methods to use SOG.IsAttachment rather than SOP.IsAttachment

0.6.0-stable
Justin Clarke Casey 2008-11-01 22:04:35 +00:00
parent 44e377d1fb
commit 9366a234cf
7 changed files with 15 additions and 16 deletions

View File

@ -611,7 +611,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land
{
if (obj != null)
{
if ((obj is SceneObjectGroup) && ((SceneObjectGroup)obj).RootPart != null && !((SceneObjectGroup)obj).RootPart.IsAttachment)
if ((obj is SceneObjectGroup) && !((SceneObjectGroup)obj).IsDeleted && !((SceneObjectGroup)obj).IsAttachment)
{
m_scene.EventManager.TriggerParcelPrimCountAdd((SceneObjectGroup)obj);
}

View File

@ -757,10 +757,9 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions
SceneObjectPart part = scene.GetSceneObjectPart(objectID);
if (part.OwnerID != moverID)
{
if (part.ParentGroup != null &&
part.ParentGroup.RootPart != null)
if (part.ParentGroup != null && !part.ParentGroup.IsDeleted)
{
if (part.ParentGroup.RootPart.IsAttachment)
if (part.ParentGroup.IsAttachment)
return false;
}
}

View File

@ -1138,7 +1138,7 @@ namespace OpenSim.Region.Environment.Scenes
SceneObjectGroup group = GetGroupByPrim(localID);
if (group != null)
{
if (m_parentScene.ExternalChecks.ExternalChecksCanMoveObject(group.UUID, remoteClient.AgentId) || group.RootPart.IsAttachment)
if (m_parentScene.ExternalChecks.ExternalChecksCanMoveObject(group.UUID, remoteClient.AgentId) || group.IsAttachment)
{
group.UpdateSinglePosition(pos, localID);
}
@ -1158,13 +1158,13 @@ namespace OpenSim.Region.Environment.Scenes
{
// Vector3 oldPos = group.AbsolutePosition;
if (group.RootPart.IsAttachment)
if (group.IsAttachment)
{
group.UpdateGroupPosition(pos);
}
else
{
if (m_parentScene.ExternalChecks.ExternalChecksCanMoveObject(group.UUID, remoteClient.AgentId) || group.RootPart.IsAttachment)
if (m_parentScene.ExternalChecks.ExternalChecksCanMoveObject(group.UUID, remoteClient.AgentId) || group.IsAttachment)
{
group.UpdateGroupPosition(pos);
}

View File

@ -169,7 +169,7 @@ namespace OpenSim.Region.Environment.Scenes
//
part.ParentGroup.IsSelected = false;
if (part.ParentGroup.RootPart.IsAttachment)
if (part.ParentGroup.IsAttachment)
isAttachment = true;
else
part.ParentGroup.ScheduleGroupForFullUpdate();

View File

@ -225,7 +225,7 @@ namespace OpenSim.Region.Environment.Scenes
{
Vector3 val = value;
if ((val.X > 257f || val.X < -1f || val.Y > 257f || val.Y < -1f) && !m_rootPart.IsAttachment)
if ((val.X > 257f || val.X < -1f || val.Y > 257f || val.Y < -1f) && !IsAttachment)
{
m_scene.CrossPrimGroupIntoNewRegion(val, this);
}
@ -1212,7 +1212,7 @@ namespace OpenSim.Region.Environment.Scenes
if (HasGroupChanged)
{
// don't backup while it's selected or you're asking for changes mid stream.
if ((!IsSelected) && (RootPart != null) && (!m_rootPart.IsAttachment))
if (!(IsSelected || IsDeleted || IsAttachment))
{
m_log.DebugFormat(
"[SCENE]: Storing {0}, {1} in {2}",
@ -1271,7 +1271,7 @@ namespace OpenSim.Region.Environment.Scenes
{
if (m_rootPart != null && m_rootPart.UUID == part.UUID)
{
if (m_rootPart.IsAttachment)
if (IsAttachment)
{
part.SendFullUpdateToClient(remoteClient, m_rootPart.AttachedPos, clientFlags);
}
@ -1441,7 +1441,7 @@ namespace OpenSim.Region.Environment.Scenes
{
if (rootpart.PhysActor != null)
{
if (rootpart.IsAttachment)
if (IsAttachment)
{
ScenePresence avatar = m_scene.GetScenePresence(rootpart.AttachedAvatar);
if (avatar != null)
@ -1580,7 +1580,7 @@ namespace OpenSim.Region.Environment.Scenes
lock (m_parts)
{
//if (m_rootPart.m_IsAttachment)
//if (IsAttachment)
//{
//foreach (SceneObjectPart part in m_parts.Values)
//{
@ -2437,7 +2437,7 @@ namespace OpenSim.Region.Environment.Scenes
{
if (m_scene.EventManager.TriggerGroupMove(UUID, pos))
{
if (m_rootPart.IsAttachment)
if (IsAttachment)
{
m_rootPart.AttachedPos = pos;
}

View File

@ -2861,7 +2861,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
m_host.AddScriptLPS(1);
if (m_host.ParentGroup.RootPart.IsAttachment && (UUID)agent == m_host.ParentGroup.RootPart.AttachedAvatar)
if (m_host.ParentGroup.IsAttachment && (UUID)agent == m_host.ParentGroup.RootPart.AttachedAvatar)
{
// When attached, certain permissions are implicit if requested from owner
int implicitPerms = ScriptBaseClass.PERMISSION_TAKE_CONTROLS |

View File

@ -545,7 +545,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
{
UUID appDomain = assetID;
if (part.ParentGroup.RootPart.IsAttachment)
if (part.ParentGroup.IsAttachment)
appDomain = part.ParentGroup.RootPart.UUID;
if (!m_AppDomains.ContainsKey(appDomain))