aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/XEngine/EventManager.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/ScriptEngine/XEngine/EventManager.cs')
-rw-r--r--OpenSim/Region/ScriptEngine/XEngine/EventManager.cs60
1 files changed, 41 insertions, 19 deletions
diff --git a/OpenSim/Region/ScriptEngine/XEngine/EventManager.cs b/OpenSim/Region/ScriptEngine/XEngine/EventManager.cs
index a4b9d4c..3a01dc6 100644
--- a/OpenSim/Region/ScriptEngine/XEngine/EventManager.cs
+++ b/OpenSim/Region/ScriptEngine/XEngine/EventManager.cs
@@ -80,7 +80,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
80 } 80 }
81 } 81 }
82 82
83 public void touch_start(uint localID, LLVector3 offsetPos, 83 public void touch_start(uint localID, uint originalID, LLVector3 offsetPos,
84 IClientAPI remoteClient) 84 IClientAPI remoteClient)
85 { 85 {
86 // Add to queue for all scripts in ObjectID object 86 // Add to queue for all scripts in ObjectID object
@@ -89,19 +89,27 @@ namespace OpenSim.Region.ScriptEngine.XEngine
89 det[0].Key = remoteClient.AgentId; 89 det[0].Key = remoteClient.AgentId;
90 det[0].Populate(myScriptEngine.World); 90 det[0].Populate(myScriptEngine.World);
91 91
92 SceneObjectPart part = myScriptEngine.World.GetSceneObjectPart( 92
93 localID); 93 if (originalID == 0)
94 if (part == null) 94 {
95 return; 95 SceneObjectPart part = myScriptEngine.World.GetSceneObjectPart(localID);
96 96 if (part == null)
97 det[0].LinkNum = part.LinkNum; 97 return;
98 98
99 det[0].LinkNum = part.LinkNum;
100 }
101 else
102 {
103 SceneObjectPart originalPart = myScriptEngine.World.GetSceneObjectPart(originalID);
104 det[0].LinkNum = originalPart.LinkNum;
105 }
106
99 myScriptEngine.PostObjectEvent(localID, new EventParams( 107 myScriptEngine.PostObjectEvent(localID, new EventParams(
100 "touch_start", new Object[] { new LSL_Types.LSLInteger(1) }, 108 "touch_start", new Object[] { new LSL_Types.LSLInteger(1) },
101 det)); 109 det));
102 } 110 }
103 111
104 public void touch(uint localID, LLVector3 offsetPos, 112 public void touch(uint localID, uint originalID, LLVector3 offsetPos,
105 IClientAPI remoteClient) 113 IClientAPI remoteClient)
106 { 114 {
107 // Add to queue for all scripts in ObjectID object 115 // Add to queue for all scripts in ObjectID object
@@ -113,19 +121,26 @@ namespace OpenSim.Region.ScriptEngine.XEngine
113 offsetPos.Y, 121 offsetPos.Y,
114 offsetPos.Z); 122 offsetPos.Z);
115 123
116 SceneObjectPart part = myScriptEngine.World.GetSceneObjectPart( 124 if (originalID == 0)
117 localID); 125 {
118 if (part == null) 126 SceneObjectPart part = myScriptEngine.World.GetSceneObjectPart(localID);
119 return; 127 if (part == null)
128 return;
120 129
121 det[0].LinkNum = part.LinkNum; 130 det[0].LinkNum = part.LinkNum;
131 }
132 else
133 {
134 SceneObjectPart originalPart = myScriptEngine.World.GetSceneObjectPart(originalID);
135 det[0].LinkNum = originalPart.LinkNum;
136 }
122 137
123 myScriptEngine.PostObjectEvent(localID, new EventParams( 138 myScriptEngine.PostObjectEvent(localID, new EventParams(
124 "touch", new Object[] { new LSL_Types.LSLInteger(1) }, 139 "touch", new Object[] { new LSL_Types.LSLInteger(1) },
125 det)); 140 det));
126 } 141 }
127 142
128 public void touch_end(uint localID, IClientAPI remoteClient) 143 public void touch_end(uint localID, uint originalID, IClientAPI remoteClient)
129 { 144 {
130 // Add to queue for all scripts in ObjectID object 145 // Add to queue for all scripts in ObjectID object
131 DetectParams[] det = new DetectParams[1]; 146 DetectParams[] det = new DetectParams[1];
@@ -133,12 +148,19 @@ namespace OpenSim.Region.ScriptEngine.XEngine
133 det[0].Key = remoteClient.AgentId; 148 det[0].Key = remoteClient.AgentId;
134 det[0].Populate(myScriptEngine.World); 149 det[0].Populate(myScriptEngine.World);
135 150
136 SceneObjectPart part = myScriptEngine.World.GetSceneObjectPart( 151 if (originalID == 0)
137 localID); 152 {
138 if (part == null) 153 SceneObjectPart part = myScriptEngine.World.GetSceneObjectPart(localID);
139 return; 154 if (part == null)
155 return;
140 156
141 det[0].LinkNum = part.LinkNum; 157 det[0].LinkNum = part.LinkNum;
158 }
159 else
160 {
161 SceneObjectPart originalPart = myScriptEngine.World.GetSceneObjectPart(originalID);
162 det[0].LinkNum = originalPart.LinkNum;
163 }
142 164
143 myScriptEngine.PostObjectEvent(localID, new EventParams( 165 myScriptEngine.PostObjectEvent(localID, new EventParams(
144 "touch_end", new Object[] { new LSL_Types.LSLInteger(1) }, 166 "touch_end", new Object[] { new LSL_Types.LSLInteger(1) },