diff options
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 44 |
1 files changed, 42 insertions, 2 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index 69491b7..2aeccd8 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | |||
@@ -828,6 +828,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
828 | public UUID FromFolderID { get; set; } | 828 | public UUID FromFolderID { get; set; } |
829 | 829 | ||
830 | /// <summary> | 830 | /// <summary> |
831 | /// If true then grabs are blocked no matter what the individual part BlockGrab setting. | ||
832 | /// </summary> | ||
833 | /// <value><c>true</c> if block grab override; otherwise, <c>false</c>.</value> | ||
834 | public bool BlockGrabOverride { get; set; } | ||
835 | |||
836 | /// <summary> | ||
831 | /// IDs of all avatars sat on this scene object. | 837 | /// IDs of all avatars sat on this scene object. |
832 | /// </summary> | 838 | /// </summary> |
833 | /// <remarks> | 839 | /// <remarks> |
@@ -902,6 +908,34 @@ namespace OpenSim.Region.Framework.Scenes | |||
902 | } | 908 | } |
903 | } | 909 | } |
904 | 910 | ||
911 | public void LoadScriptState(XmlReader reader) | ||
912 | { | ||
913 | // m_log.DebugFormat("[SCENE OBJECT GROUP]: Looking for script state for {0} in {1}", Name); | ||
914 | |||
915 | while (reader.ReadToFollowing("SavedScriptState")) | ||
916 | { | ||
917 | // m_log.DebugFormat("[SCENE OBJECT GROUP]: Loading script state for {0}", Name); | ||
918 | |||
919 | if (m_savedScriptState == null) | ||
920 | m_savedScriptState = new Dictionary<UUID, string>(); | ||
921 | |||
922 | string uuid = reader.GetAttribute("UUID"); | ||
923 | |||
924 | if (uuid != null) | ||
925 | { | ||
926 | // m_log.DebugFormat("[SCENE OBJECT GROUP]: Found state for item ID {0} in object {1}", uuid, Name); | ||
927 | |||
928 | UUID itemid = new UUID(uuid); | ||
929 | if (itemid != UUID.Zero) | ||
930 | m_savedScriptState[itemid] = reader.ReadInnerXml(); | ||
931 | } | ||
932 | else | ||
933 | { | ||
934 | m_log.WarnFormat("[SCENE OBJECT GROUP]: SavedScriptState element had no UUID in object {0}", Name); | ||
935 | } | ||
936 | } | ||
937 | } | ||
938 | |||
905 | /// <summary> | 939 | /// <summary> |
906 | /// Hooks this object up to the backup event so that it is persisted to the database when the update thread executes. | 940 | /// Hooks this object up to the backup event so that it is persisted to the database when the update thread executes. |
907 | /// </summary> | 941 | /// </summary> |
@@ -2582,20 +2616,26 @@ namespace OpenSim.Region.Framework.Scenes | |||
2582 | /// If object is physical, apply force to move it around | 2616 | /// If object is physical, apply force to move it around |
2583 | /// If object is not physical, just put it at the resulting location | 2617 | /// If object is not physical, just put it at the resulting location |
2584 | /// </summary> | 2618 | /// </summary> |
2619 | /// <param name="partID">Part ID to check for grab</param> | ||
2585 | /// <param name="offset">Always seems to be 0,0,0, so ignoring</param> | 2620 | /// <param name="offset">Always seems to be 0,0,0, so ignoring</param> |
2586 | /// <param name="pos">New position. We do the math here to turn it into a force</param> | 2621 | /// <param name="pos">New position. We do the math here to turn it into a force</param> |
2587 | /// <param name="remoteClient"></param> | 2622 | /// <param name="remoteClient"></param> |
2588 | public void GrabMovement(Vector3 offset, Vector3 pos, IClientAPI remoteClient) | 2623 | public void GrabMovement(UUID partID, Vector3 offset, Vector3 pos, IClientAPI remoteClient) |
2589 | { | 2624 | { |
2590 | if (m_scene.EventManager.TriggerGroupMove(UUID, pos)) | 2625 | if (m_scene.EventManager.TriggerGroupMove(UUID, pos)) |
2591 | { | 2626 | { |
2627 | SceneObjectPart part = GetPart(partID); | ||
2628 | |||
2629 | if (part == null) | ||
2630 | return; | ||
2631 | |||
2592 | PhysicsActor pa = m_rootPart.PhysActor; | 2632 | PhysicsActor pa = m_rootPart.PhysActor; |
2593 | 2633 | ||
2594 | if (pa != null) | 2634 | if (pa != null) |
2595 | { | 2635 | { |
2596 | if (pa.IsPhysical) | 2636 | if (pa.IsPhysical) |
2597 | { | 2637 | { |
2598 | if (!m_rootPart.BlockGrab) | 2638 | if (!BlockGrabOverride && !part.BlockGrab) |
2599 | { | 2639 | { |
2600 | Vector3 llmoveforce = pos - AbsolutePosition; | 2640 | Vector3 llmoveforce = pos - AbsolutePosition; |
2601 | Vector3 grabforce = llmoveforce; | 2641 | Vector3 grabforce = llmoveforce; |