diff options
Diffstat (limited to 'OpenSim/Region/ScriptEngine/XEngine/XEngine.cs')
-rw-r--r-- | OpenSim/Region/ScriptEngine/XEngine/XEngine.cs | 24 |
1 files changed, 7 insertions, 17 deletions
diff --git a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs index 61985e8..2713080 100644 --- a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs +++ b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs | |||
@@ -551,7 +551,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
551 | /// <param name="instance"></param> | 551 | /// <param name="instance"></param> |
552 | /// <param name="keySelector">Basis on which to sort output. Can be null if no sort needs to take place</param> | 552 | /// <param name="keySelector">Basis on which to sort output. Can be null if no sort needs to take place</param> |
553 | private void HandleScriptsAction<TKey>( | 553 | private void HandleScriptsAction<TKey>( |
554 | string[] cmdparams, Action<IScriptInstance> action, Func<IScriptInstance, TKey> keySelector) | 554 | string[] cmdparams, Action<IScriptInstance> action, System.Func<IScriptInstance, TKey> keySelector) |
555 | { | 555 | { |
556 | if (!(MainConsole.Instance.ConsoleScene == null || MainConsole.Instance.ConsoleScene == m_Scene)) | 556 | if (!(MainConsole.Instance.ConsoleScene == null || MainConsole.Instance.ConsoleScene == m_Scene)) |
557 | return; | 557 | return; |
@@ -1633,7 +1633,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
1633 | startInfo.MaxWorkerThreads = maxThreads; | 1633 | startInfo.MaxWorkerThreads = maxThreads; |
1634 | startInfo.MinWorkerThreads = minThreads; | 1634 | startInfo.MinWorkerThreads = minThreads; |
1635 | startInfo.ThreadPriority = threadPriority;; | 1635 | startInfo.ThreadPriority = threadPriority;; |
1636 | startInfo.StackSize = stackSize; | 1636 | startInfo.MaxStackSize = stackSize; |
1637 | startInfo.StartSuspended = true; | 1637 | startInfo.StartSuspended = true; |
1638 | 1638 | ||
1639 | m_ThreadPool = new SmartThreadPool(startInfo); | 1639 | m_ThreadPool = new SmartThreadPool(startInfo); |
@@ -1827,9 +1827,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
1827 | public bool GetScriptState(UUID itemID) | 1827 | public bool GetScriptState(UUID itemID) |
1828 | { | 1828 | { |
1829 | IScriptInstance instance = GetInstance(itemID); | 1829 | IScriptInstance instance = GetInstance(itemID); |
1830 | if (instance != null) | 1830 | return instance != null && instance.Running; |
1831 | return instance.Running; | ||
1832 | return false; | ||
1833 | } | 1831 | } |
1834 | 1832 | ||
1835 | [DebuggerNonUserCode] | 1833 | [DebuggerNonUserCode] |
@@ -1874,9 +1872,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
1874 | public DetectParams GetDetectParams(UUID itemID, int idx) | 1872 | public DetectParams GetDetectParams(UUID itemID, int idx) |
1875 | { | 1873 | { |
1876 | IScriptInstance instance = GetInstance(itemID); | 1874 | IScriptInstance instance = GetInstance(itemID); |
1877 | if (instance != null) | 1875 | return instance != null ? instance.GetDetectParams(idx) : null; |
1878 | return instance.GetDetectParams(idx); | ||
1879 | return null; | ||
1880 | } | 1876 | } |
1881 | 1877 | ||
1882 | public void SetMinEventDelay(UUID itemID, double delay) | 1878 | public void SetMinEventDelay(UUID itemID, double delay) |
@@ -1889,9 +1885,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
1889 | public UUID GetDetectID(UUID itemID, int idx) | 1885 | public UUID GetDetectID(UUID itemID, int idx) |
1890 | { | 1886 | { |
1891 | IScriptInstance instance = GetInstance(itemID); | 1887 | IScriptInstance instance = GetInstance(itemID); |
1892 | if (instance != null) | 1888 | return instance != null ? instance.GetDetectID(idx) : UUID.Zero; |
1893 | return instance.GetDetectID(idx); | ||
1894 | return UUID.Zero; | ||
1895 | } | 1889 | } |
1896 | 1890 | ||
1897 | [DebuggerNonUserCode] | 1891 | [DebuggerNonUserCode] |
@@ -1906,9 +1900,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
1906 | public int GetStartParameter(UUID itemID) | 1900 | public int GetStartParameter(UUID itemID) |
1907 | { | 1901 | { |
1908 | IScriptInstance instance = GetInstance(itemID); | 1902 | IScriptInstance instance = GetInstance(itemID); |
1909 | if (instance == null) | 1903 | return instance == null ? 0 : instance.StartParam; |
1910 | return 0; | ||
1911 | return instance.StartParam; | ||
1912 | } | 1904 | } |
1913 | 1905 | ||
1914 | public void OnShutdown() | 1906 | public void OnShutdown() |
@@ -1941,9 +1933,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
1941 | public IScriptApi GetApi(UUID itemID, string name) | 1933 | public IScriptApi GetApi(UUID itemID, string name) |
1942 | { | 1934 | { |
1943 | IScriptInstance instance = GetInstance(itemID); | 1935 | IScriptInstance instance = GetInstance(itemID); |
1944 | if (instance == null) | 1936 | return instance == null ? null : instance.GetApi(name); |
1945 | return null; | ||
1946 | return instance.GetApi(name); | ||
1947 | } | 1937 | } |
1948 | 1938 | ||
1949 | public void OnGetScriptRunning(IClientAPI controllingClient, UUID objectID, UUID itemID) | 1939 | public void OnGetScriptRunning(IClientAPI controllingClient, UUID objectID, UUID itemID) |