diff options
author | Justin Clark-Casey (justincc) | 2012-05-08 22:58:34 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2012-05-08 23:05:01 +0100 |
commit | 01b78235db71994ba3e37bd6ea297bed7e4576b9 (patch) | |
tree | 91a89fd18939632973180287f78085723b6b9b9c /OpenSim/Region/ScriptEngine/Shared/Api/Implementation/MOD_Api.cs | |
parent | Perform SceneGraph.DuplicateObject() under existing m_updateLock already used... (diff) | |
download | opensim-SC_OLD-01b78235db71994ba3e37bd6ea297bed7e4576b9.zip opensim-SC_OLD-01b78235db71994ba3e37bd6ea297bed7e4576b9.tar.gz opensim-SC_OLD-01b78235db71994ba3e37bd6ea297bed7e4576b9.tar.bz2 opensim-SC_OLD-01b78235db71994ba3e37bd6ea297bed7e4576b9.tar.xz |
Instead of constantly looking up unchanging self item in script code, pass in self item on initialization.
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Api/Implementation/MOD_Api.cs')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/MOD_Api.cs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/MOD_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/MOD_Api.cs index 7c07e15..a578b50 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/MOD_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/MOD_Api.cs | |||
@@ -58,16 +58,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
58 | internal IScriptEngine m_ScriptEngine; | 58 | internal IScriptEngine m_ScriptEngine; |
59 | internal SceneObjectPart m_host; | 59 | internal SceneObjectPart m_host; |
60 | internal uint m_localID; | 60 | internal uint m_localID; |
61 | internal UUID m_itemID; | 61 | internal TaskInventoryItem m_item; |
62 | internal bool m_MODFunctionsEnabled = false; | 62 | internal bool m_MODFunctionsEnabled = false; |
63 | internal IScriptModuleComms m_comms = null; | 63 | internal IScriptModuleComms m_comms = null; |
64 | 64 | ||
65 | public void Initialize(IScriptEngine ScriptEngine, SceneObjectPart host, uint localID, UUID itemID) | 65 | public void Initialize(IScriptEngine ScriptEngine, SceneObjectPart host, uint localID, TaskInventoryItem item) |
66 | { | 66 | { |
67 | m_ScriptEngine = ScriptEngine; | 67 | m_ScriptEngine = ScriptEngine; |
68 | m_host = host; | 68 | m_host = host; |
69 | m_localID = localID; | 69 | m_localID = localID; |
70 | m_itemID = itemID; | 70 | m_item = item; |
71 | 71 | ||
72 | if (m_ScriptEngine.Config.GetBoolean("AllowMODFunctions", false)) | 72 | if (m_ScriptEngine.Config.GetBoolean("AllowMODFunctions", false)) |
73 | m_MODFunctionsEnabled = true; | 73 | m_MODFunctionsEnabled = true; |
@@ -252,7 +252,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
252 | // non-null but don't trust it completely | 252 | // non-null but don't trust it completely |
253 | try | 253 | try |
254 | { | 254 | { |
255 | object result = m_comms.InvokeOperation(m_host.UUID, m_itemID, fname, convertedParms); | 255 | object result = m_comms.InvokeOperation(m_host.UUID, m_item.ItemID, fname, convertedParms); |
256 | if (result != null) | 256 | if (result != null) |
257 | return result; | 257 | return result; |
258 | 258 | ||
@@ -279,7 +279,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
279 | 279 | ||
280 | UUID req = UUID.Random(); | 280 | UUID req = UUID.Random(); |
281 | 281 | ||
282 | m_comms.RaiseEvent(m_itemID, req.ToString(), module, command, k); | 282 | m_comms.RaiseEvent(m_item.ItemID, req.ToString(), module, command, k); |
283 | 283 | ||
284 | return req.ToString(); | 284 | return req.ToString(); |
285 | } | 285 | } |