From 2852cda727f86567c18c6fab193ed31195c9934c Mon Sep 17 00:00:00 2001
From: MW
Date: Sun, 1 Jul 2007 21:04:33 +0000
Subject: More work on SceneObject/Primitive and building (Linking is a work in
progress as is all). Committing now as I've finished for the night and will
be continued tomorrow.
---
.../Environment/Scenes/Scene.PacketHandlers.cs | 40 ++++++++++++++++++++--
1 file changed, 38 insertions(+), 2 deletions(-)
(limited to 'OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs')
diff --git a/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs b/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs
index f55c118..d8533b0 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs
@@ -193,8 +193,41 @@ namespace OpenSim.Region.Environment.Scenes
///
public void LinkObjects(uint parentPrim, List childPrims)
{
-
+ SceneObject parenPrim = null;
+ foreach (EntityBase ent in Entities.Values)
+ {
+ if (ent is SceneObject)
+ {
+ if (((SceneObject)ent).rootLocalID == parentPrim)
+ {
+ parenPrim = (SceneObject)ent;
+ break;
+ }
+ }
+ }
+ List children = new List();
+ if (parenPrim != null)
+ {
+ for (int i = 0; i < childPrims.Count; i++)
+ {
+ foreach (EntityBase ent in Entities.Values)
+ {
+ if (ent is SceneObject)
+ {
+ if (((SceneObject)ent).rootLocalID == childPrims[i])
+ {
+ children.Add((SceneObject)ent);
+ }
+ }
+ }
+ }
+ }
+
+ foreach (SceneObject sceneObj in children)
+ {
+ parenPrim.AddNewChildPrims(sceneObj);
+ }
}
///
@@ -275,7 +308,10 @@ namespace OpenSim.Region.Environment.Scenes
{
if (this.Entities.ContainsKey(objectID))
{
- ((PrimitiveOld)this.Entities[objectID]).GrapMovement(offset, pos, remoteClient);
+ if (this.Entities[objectID] is SceneObject)
+ {
+ ((SceneObject)this.Entities[objectID]).GrapMovement(offset, pos, remoteClient);
+ }
}
}
--
cgit v1.1