aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Scenes/InnerScene.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/InnerScene.cs')
-rw-r--r--OpenSim/Region/Environment/Scenes/InnerScene.cs55
1 files changed, 50 insertions, 5 deletions
diff --git a/OpenSim/Region/Environment/Scenes/InnerScene.cs b/OpenSim/Region/Environment/Scenes/InnerScene.cs
index 2b28b2a..668e50f 100644
--- a/OpenSim/Region/Environment/Scenes/InnerScene.cs
+++ b/OpenSim/Region/Environment/Scenes/InnerScene.cs
@@ -293,9 +293,46 @@ namespace OpenSim.Region.Environment.Scenes
293 } 293 }
294 } 294 }
295 } 295 }
296 public void DetachObject(uint objectLocalID, IClientAPI remoteClient)
297 {
298 List<EntityBase> EntityList = GetEntities();
296 299
300 foreach (EntityBase obj in EntityList)
301 {
302 if (obj is SceneObjectGroup)
303 {
304 if (((SceneObjectGroup)obj).LocalId == objectLocalID)
305 {
306 SceneObjectGroup group = (SceneObjectGroup)obj;
307 group.DetachToGround();
308 }
309 }
310 }
311
312 }
297 public void AttachObject(IClientAPI remoteClient, uint objectLocalID, uint AttachmentPt, LLQuaternion rot) 313 public void AttachObject(IClientAPI remoteClient, uint objectLocalID, uint AttachmentPt, LLQuaternion rot)
298 { 314 {
315 List<EntityBase> EntityList = GetEntities();
316
317 foreach (EntityBase obj in EntityList)
318 {
319 if (obj is SceneObjectGroup)
320 {
321 if (((SceneObjectGroup)obj).LocalId == objectLocalID)
322 {
323 SceneObjectGroup group = (SceneObjectGroup)obj;
324 group.AttachToAgent(remoteClient.AgentId, AttachmentPt);
325
326 }
327
328 }
329 }
330
331 }
332 // Use the above method.
333 public void AttachObject(IClientAPI remoteClient, uint objectLocalID, uint AttachmentPt, LLQuaternion rot,
334 bool deadMethod)
335 {
299 Console.WriteLine("Attaching object " + objectLocalID + " to " + AttachmentPt); 336 Console.WriteLine("Attaching object " + objectLocalID + " to " + AttachmentPt);
300 SceneObjectPart p = GetSceneObjectPart(objectLocalID); 337 SceneObjectPart p = GetSceneObjectPart(objectLocalID);
301 if (p != null) 338 if (p != null)
@@ -1005,15 +1042,23 @@ namespace OpenSim.Region.Environment.Scenes
1005 SceneObjectGroup group = GetGroupByPrim(localID); 1042 SceneObjectGroup group = GetGroupByPrim(localID);
1006 if (group != null) 1043 if (group != null)
1007 { 1044 {
1045
1008 LLVector3 oldPos = group.AbsolutePosition; 1046 LLVector3 oldPos = group.AbsolutePosition;
1009 if (!PermissionsMngr.CanObjectEntry(remoteClient.AgentId, oldPos, pos)) 1047 if (group.RootPart.m_IsAttachment)
1010 { 1048 {
1011 group.SendGroupTerseUpdate(); 1049 group.UpdateGroupPosition(pos);
1012 return;
1013 } 1050 }
1014 if (PermissionsMngr.CanEditObjectPosition(remoteClient.AgentId, group.UUID)) 1051 else
1015 { 1052 {
1016 group.UpdateGroupPosition(pos); 1053 if (!PermissionsMngr.CanObjectEntry(remoteClient.AgentId, oldPos, pos))
1054 {
1055 group.SendGroupTerseUpdate();
1056 return;
1057 }
1058 if (PermissionsMngr.CanEditObjectPosition(remoteClient.AgentId, group.UUID))
1059 {
1060 group.UpdateGroupPosition(pos);
1061 }
1017 } 1062 }
1018 } 1063 }
1019 } 1064 }