aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorEva Comaroski2013-12-06 13:12:35 +0000
committerJustin Clark-Casey (justincc)2013-12-14 01:20:24 +0000
commit63ccc3dbf595d56fb9f08ee9575b81f3b39ca290 (patch)
tree6b7a8012f552b797df97e4978d01ab3d08b1d80f
parentMake WindParamSet success a console message rather than a log message. (diff)
downloadopensim-SC_OLD-63ccc3dbf595d56fb9f08ee9575b81f3b39ca290.zip
opensim-SC_OLD-63ccc3dbf595d56fb9f08ee9575b81f3b39ca290.tar.gz
opensim-SC_OLD-63ccc3dbf595d56fb9f08ee9575b81f3b39ca290.tar.bz2
opensim-SC_OLD-63ccc3dbf595d56fb9f08ee9575b81f3b39ca290.tar.xz
Convert if-blocks to return statements in small functions such as GetStartParameter().
-rw-r--r--OpenSim/Region/ScriptEngine/XEngine/XEngine.cs20
1 files changed, 5 insertions, 15 deletions
diff --git a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
index 5804aa8..b261b9f 100644
--- a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
+++ b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
@@ -1709,9 +1709,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
1709 public bool GetScriptState(UUID itemID) 1709 public bool GetScriptState(UUID itemID)
1710 { 1710 {
1711 IScriptInstance instance = GetInstance(itemID); 1711 IScriptInstance instance = GetInstance(itemID);
1712 if (instance != null) 1712 return instance != null && instance.Running;
1713 return instance.Running;
1714 return false;
1715 } 1713 }
1716 1714
1717 public void ApiResetScript(UUID itemID) 1715 public void ApiResetScript(UUID itemID)
@@ -1755,9 +1753,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
1755 public DetectParams GetDetectParams(UUID itemID, int idx) 1753 public DetectParams GetDetectParams(UUID itemID, int idx)
1756 { 1754 {
1757 IScriptInstance instance = GetInstance(itemID); 1755 IScriptInstance instance = GetInstance(itemID);
1758 if (instance != null) 1756 return instance != null ? instance.GetDetectParams(idx) : null;
1759 return instance.GetDetectParams(idx);
1760 return null;
1761 } 1757 }
1762 1758
1763 public void SetMinEventDelay(UUID itemID, double delay) 1759 public void SetMinEventDelay(UUID itemID, double delay)
@@ -1770,9 +1766,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
1770 public UUID GetDetectID(UUID itemID, int idx) 1766 public UUID GetDetectID(UUID itemID, int idx)
1771 { 1767 {
1772 IScriptInstance instance = GetInstance(itemID); 1768 IScriptInstance instance = GetInstance(itemID);
1773 if (instance != null) 1769 return instance != null ? instance.GetDetectID(idx) : UUID.Zero;
1774 return instance.GetDetectID(idx);
1775 return UUID.Zero;
1776 } 1770 }
1777 1771
1778 public void SetState(UUID itemID, string newState) 1772 public void SetState(UUID itemID, string newState)
@@ -1786,9 +1780,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
1786 public int GetStartParameter(UUID itemID) 1780 public int GetStartParameter(UUID itemID)
1787 { 1781 {
1788 IScriptInstance instance = GetInstance(itemID); 1782 IScriptInstance instance = GetInstance(itemID);
1789 if (instance == null) 1783 return instance == null ? 0 : instance.StartParam;
1790 return 0;
1791 return instance.StartParam;
1792 } 1784 }
1793 1785
1794 public void OnShutdown() 1786 public void OnShutdown()
@@ -1822,9 +1814,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
1822 public IScriptApi GetApi(UUID itemID, string name) 1814 public IScriptApi GetApi(UUID itemID, string name)
1823 { 1815 {
1824 IScriptInstance instance = GetInstance(itemID); 1816 IScriptInstance instance = GetInstance(itemID);
1825 if (instance == null) 1817 return instance == null ? null : instance.GetApi(name);
1826 return null;
1827 return instance.GetApi(name);
1828 } 1818 }
1829 1819
1830 public void OnGetScriptRunning(IClientAPI controllingClient, UUID objectID, UUID itemID) 1820 public void OnGetScriptRunning(IClientAPI controllingClient, UUID objectID, UUID itemID)