diff options
author | Justin Clark-Casey (justincc) | 2011-08-27 00:15:21 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2011-08-27 00:15:21 +0100 |
commit | 33a894f3d2cc95a7a512b86f39f3c6a6afabb015 (patch) | |
tree | 064edbd623ea0bd7bb85c29dc28d2348feb8454b /OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |
parent | refactor: simplify SOP.AttachedAvatar into SOG.AttachedAvatar (diff) | |
download | opensim-SC_OLD-33a894f3d2cc95a7a512b86f39f3c6a6afabb015.zip opensim-SC_OLD-33a894f3d2cc95a7a512b86f39f3c6a6afabb015.tar.gz opensim-SC_OLD-33a894f3d2cc95a7a512b86f39f3c6a6afabb015.tar.bz2 opensim-SC_OLD-33a894f3d2cc95a7a512b86f39f3c6a6afabb015.tar.xz |
refactor: move SOP.IsAttachment and AttachmentPoint up into SOG to avoid pointless duplication of identical values
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 81f1f38..a7f08d9 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -1965,7 +1965,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1965 | 1965 | ||
1966 | if (part.ParentGroup.RootPart == part) | 1966 | if (part.ParentGroup.RootPart == part) |
1967 | { | 1967 | { |
1968 | if ((targetPos.z < ground) && disable_underground_movement && m_host.AttachmentPoint == 0) | 1968 | if ((targetPos.z < ground) && disable_underground_movement && m_host.ParentGroup.AttachmentPoint == 0) |
1969 | targetPos.z = ground; | 1969 | targetPos.z = ground; |
1970 | SceneObjectGroup parent = part.ParentGroup; | 1970 | SceneObjectGroup parent = part.ParentGroup; |
1971 | LSL_Vector real_vec = SetPosAdjust(currentPos, targetPos); | 1971 | LSL_Vector real_vec = SetPosAdjust(currentPos, targetPos); |
@@ -2097,7 +2097,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2097 | Quaternion q; | 2097 | Quaternion q; |
2098 | if (part.LinkNum == 0 || part.LinkNum == 1) // unlinked or root prim | 2098 | if (part.LinkNum == 0 || part.LinkNum == 1) // unlinked or root prim |
2099 | { | 2099 | { |
2100 | if (part.ParentGroup.RootPart.AttachmentPoint != 0) | 2100 | if (part.ParentGroup.AttachmentPoint != 0) |
2101 | { | 2101 | { |
2102 | ScenePresence avatar = World.GetScenePresence(part.ParentGroup.AttachedAvatar); | 2102 | ScenePresence avatar = World.GetScenePresence(part.ParentGroup.AttachedAvatar); |
2103 | if (avatar != null) | 2103 | if (avatar != null) |
@@ -2241,7 +2241,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2241 | 2241 | ||
2242 | Vector3 vel; | 2242 | Vector3 vel; |
2243 | 2243 | ||
2244 | if (m_host.IsAttachment) | 2244 | if (m_host.ParentGroup.IsAttachment) |
2245 | { | 2245 | { |
2246 | ScenePresence avatar = m_host.ParentGroup.Scene.GetScenePresence(m_host.ParentGroup.AttachedAvatar); | 2246 | ScenePresence avatar = m_host.ParentGroup.Scene.GetScenePresence(m_host.ParentGroup.AttachedAvatar); |
2247 | vel = avatar.Velocity; | 2247 | vel = avatar.Velocity; |
@@ -2997,7 +2997,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2997 | { | 2997 | { |
2998 | m_host.AddScriptLPS(1); | 2998 | m_host.AddScriptLPS(1); |
2999 | 2999 | ||
3000 | if (m_host.ParentGroup.RootPart.AttachmentPoint == 0) | 3000 | if (m_host.ParentGroup.AttachmentPoint == 0) |
3001 | return; | 3001 | return; |
3002 | 3002 | ||
3003 | TaskInventoryItem item; | 3003 | TaskInventoryItem item; |
@@ -3587,7 +3587,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3587 | 3587 | ||
3588 | SceneObjectPart targetPart = World.GetSceneObjectPart((UUID)targetID); | 3588 | SceneObjectPart targetPart = World.GetSceneObjectPart((UUID)targetID); |
3589 | 3589 | ||
3590 | if (targetPart.ParentGroup.RootPart.AttachmentPoint != 0) | 3590 | if (targetPart.ParentGroup.AttachmentPoint != 0) |
3591 | return; // Fail silently if attached | 3591 | return; // Fail silently if attached |
3592 | SceneObjectGroup parentPrim = null, childPrim = null; | 3592 | SceneObjectGroup parentPrim = null, childPrim = null; |
3593 | 3593 | ||
@@ -3640,7 +3640,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3640 | 3640 | ||
3641 | SceneObjectGroup parentPrim = m_host.ParentGroup; | 3641 | SceneObjectGroup parentPrim = m_host.ParentGroup; |
3642 | 3642 | ||
3643 | if (parentPrim.RootPart.AttachmentPoint != 0) | 3643 | if (parentPrim.AttachmentPoint != 0) |
3644 | return; // Fail silently if attached | 3644 | return; // Fail silently if attached |
3645 | SceneObjectPart childPrim = null; | 3645 | SceneObjectPart childPrim = null; |
3646 | 3646 | ||
@@ -3710,7 +3710,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3710 | { | 3710 | { |
3711 | m_host.AddScriptLPS(1); | 3711 | m_host.AddScriptLPS(1); |
3712 | SceneObjectGroup parentPrim = m_host.ParentGroup; | 3712 | SceneObjectGroup parentPrim = m_host.ParentGroup; |
3713 | if (parentPrim.RootPart.AttachmentPoint != 0) | 3713 | if (parentPrim.AttachmentPoint != 0) |
3714 | return; // Fail silently if attached | 3714 | return; // Fail silently if attached |
3715 | 3715 | ||
3716 | List<SceneObjectPart> parts = new List<SceneObjectPart>(parentPrim.Parts); | 3716 | List<SceneObjectPart> parts = new List<SceneObjectPart>(parentPrim.Parts); |
@@ -4349,7 +4349,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
4349 | return; | 4349 | return; |
4350 | 4350 | ||
4351 | // Object not pushable. Not an attachment and has no physics component | 4351 | // Object not pushable. Not an attachment and has no physics component |
4352 | if (!pusheeob.IsAttachment && pusheeob.PhysActor == null) | 4352 | if (!pusheeob.ParentGroup.IsAttachment && pusheeob.PhysActor == null) |
4353 | return; | 4353 | return; |
4354 | 4354 | ||
4355 | PusheePos = pusheeob.AbsolutePosition; | 4355 | PusheePos = pusheeob.AbsolutePosition; |
@@ -5857,7 +5857,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
5857 | public LSL_Integer llGetAttached() | 5857 | public LSL_Integer llGetAttached() |
5858 | { | 5858 | { |
5859 | m_host.AddScriptLPS(1); | 5859 | m_host.AddScriptLPS(1); |
5860 | return m_host.ParentGroup.RootPart.AttachmentPoint; | 5860 | return m_host.ParentGroup.AttachmentPoint; |
5861 | } | 5861 | } |
5862 | 5862 | ||
5863 | public LSL_Integer llGetFreeMemory() | 5863 | public LSL_Integer llGetFreeMemory() |
@@ -7458,7 +7458,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
7458 | { | 7458 | { |
7459 | m_host.AddScriptLPS(1); | 7459 | m_host.AddScriptLPS(1); |
7460 | Quaternion q; | 7460 | Quaternion q; |
7461 | if (m_host.ParentGroup.RootPart.AttachmentPoint != 0) | 7461 | if (m_host.ParentGroup.AttachmentPoint != 0) |
7462 | { | 7462 | { |
7463 | ScenePresence avatar = World.GetScenePresence(m_host.ParentGroup.AttachedAvatar); | 7463 | ScenePresence avatar = World.GetScenePresence(m_host.ParentGroup.AttachedAvatar); |
7464 | if (avatar != null) | 7464 | if (avatar != null) |