diff options
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/ScenePresence.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/ScenePresence.cs | 37 |
1 files changed, 34 insertions, 3 deletions
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 6c119c2..1e8ce22 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -60,7 +60,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
60 | struct ScriptControllers | 60 | struct ScriptControllers |
61 | { | 61 | { |
62 | public UUID itemID; | 62 | public UUID itemID; |
63 | public uint objID; | ||
64 | public ScriptControlled ignoreControls; | 63 | public ScriptControlled ignoreControls; |
65 | public ScriptControlled eventControls; | 64 | public ScriptControlled eventControls; |
66 | } | 65 | } |
@@ -3057,6 +3056,18 @@ namespace OpenSim.Region.Framework.Scenes | |||
3057 | cAgent.Attachments = attachs; | 3056 | cAgent.Attachments = attachs; |
3058 | } | 3057 | } |
3059 | 3058 | ||
3059 | lock (scriptedcontrols) | ||
3060 | { | ||
3061 | ControllerData[] controls = new ControllerData[scriptedcontrols.Count]; | ||
3062 | int i = 0; | ||
3063 | |||
3064 | foreach (ScriptControllers c in scriptedcontrols.Values) | ||
3065 | { | ||
3066 | controls[i++] = new ControllerData(c.itemID, (uint)c.ignoreControls, (uint)c.eventControls); | ||
3067 | } | ||
3068 | cAgent.Controllers = controls; | ||
3069 | } | ||
3070 | |||
3060 | // Animations | 3071 | // Animations |
3061 | try | 3072 | try |
3062 | { | 3073 | { |
@@ -3137,6 +3148,27 @@ namespace OpenSim.Region.Framework.Scenes | |||
3137 | } | 3148 | } |
3138 | catch { } | 3149 | catch { } |
3139 | 3150 | ||
3151 | try | ||
3152 | { | ||
3153 | lock (scriptedcontrols) | ||
3154 | { | ||
3155 | if (cAgent.Controllers != null) | ||
3156 | { | ||
3157 | scriptedcontrols.Clear(); | ||
3158 | |||
3159 | foreach (ControllerData c in cAgent.Controllers) | ||
3160 | { | ||
3161 | ScriptControllers sc = new ScriptControllers(); | ||
3162 | sc.itemID = c.ItemID; | ||
3163 | sc.ignoreControls = (ScriptControlled)c.IgnoreControls; | ||
3164 | sc.eventControls = (ScriptControlled)c.EventControls; | ||
3165 | |||
3166 | scriptedcontrols[sc.itemID] = sc; | ||
3167 | } | ||
3168 | } | ||
3169 | } | ||
3170 | } | ||
3171 | catch { } | ||
3140 | // Animations | 3172 | // Animations |
3141 | try | 3173 | try |
3142 | { | 3174 | { |
@@ -3468,7 +3500,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
3468 | obj.eventControls = ScriptControlled.CONTROL_ZERO; | 3500 | obj.eventControls = ScriptControlled.CONTROL_ZERO; |
3469 | 3501 | ||
3470 | obj.itemID = Script_item_UUID; | 3502 | obj.itemID = Script_item_UUID; |
3471 | obj.objID = Obj_localID; | ||
3472 | if (pass_on == 0 && accept == 0) | 3503 | if (pass_on == 0 && accept == 0) |
3473 | { | 3504 | { |
3474 | IgnoredControls |= (ScriptControlled)controls; | 3505 | IgnoredControls |= (ScriptControlled)controls; |
@@ -3611,7 +3642,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3611 | if (localHeld != ScriptControlled.CONTROL_ZERO || localChange != ScriptControlled.CONTROL_ZERO) | 3642 | if (localHeld != ScriptControlled.CONTROL_ZERO || localChange != ScriptControlled.CONTROL_ZERO) |
3612 | { | 3643 | { |
3613 | // only send if still pressed or just changed | 3644 | // only send if still pressed or just changed |
3614 | m_scene.EventManager.TriggerControlEvent(scriptControlData.objID, scriptUUID, UUID, (uint)localHeld, (uint)localChange); | 3645 | m_scene.EventManager.TriggerControlEvent(scriptUUID, UUID, (uint)localHeld, (uint)localChange); |
3615 | } | 3646 | } |
3616 | } | 3647 | } |
3617 | } | 3648 | } |