From a2b1a1787d620f70c10221545414b41ffdfe27da Mon Sep 17 00:00:00 2001 From: Jeff Ames Date: Wed, 25 Jun 2008 14:30:28 +0000 Subject: Minor formatting cleanup. --- .../ScriptEngine/Common/LSL_BuiltIn_Commands.cs | 62 +++++++++++----------- .../Shared/Api/Implementation/ApiManager.cs | 8 +-- .../Api/Implementation/AsyncCommandManager.cs | 2 +- .../Shared/Api/Implementation/LSL_Api.cs | 2 +- .../ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs | 2 +- .../ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs | 2 +- .../ScriptEngine/Shared/Api/Runtime/ScriptBase.cs | 6 +-- OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs | 2 +- 8 files changed, 43 insertions(+), 43 deletions(-) (limited to 'OpenSim/Region/ScriptEngine') diff --git a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs index 08cf4a7..a9d1309 100644 --- a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs +++ b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs @@ -2697,40 +2697,40 @@ namespace OpenSim.Region.ScriptEngine.Common public void llGiveInventory(string destination, string inventory) { m_host.AddScriptLPS(1); - bool found = false; - LLUUID destId = LLUUID.Zero; - LLUUID objId = LLUUID.Zero; - - if(!LLUUID.TryParse(destination, out destId)) - { - llSay(0, "Could not parse key " + destination); - return; - } - - // move the first object found with this inventory name - foreach (KeyValuePair inv in m_host.TaskInventory) - { - if (inv.Value.Name == inventory) - { - found = true; - objId = inv.Key; - break; - } - } - - // check if destination is an avatar - if (World.GetScenePresence(destId) != null) - { - // destination is an avatar + bool found = false; + LLUUID destId = LLUUID.Zero; + LLUUID objId = LLUUID.Zero; + + if (!LLUUID.TryParse(destination, out destId)) + { + llSay(0, "Could not parse key " + destination); + return; + } + + // move the first object found with this inventory name + foreach (KeyValuePair inv in m_host.TaskInventory) + { + if (inv.Value.Name == inventory) + { + found = true; + objId = inv.Key; + break; + } + } + + // check if destination is an avatar + if (World.GetScenePresence(destId) != null) + { + // destination is an avatar World.MoveTaskInventoryItem(destId, null, m_host, objId); - } - else - { - // destination is an object + } + else + { + // destination is an object World.MoveTaskInventoryItem(destId, m_host, objId); - } + } - if (!found) + if (!found) llSay(0, "Could not find object " + inventory); } diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/ApiManager.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/ApiManager.cs index f7f2676..c57e72e 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/ApiManager.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/ApiManager.cs @@ -39,7 +39,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public string[] GetApis() { - if(m_Apis.Count > 0) + if (m_Apis.Count > 0) { List l = new List(m_Apis.Keys); return l.ToArray(); @@ -53,10 +53,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { string name = t.ToString(); int idx = name.LastIndexOf('.'); - if(idx != -1) + if (idx != -1) name = name.Substring(idx+1); - if(name.EndsWith("_Api")) + if (name.EndsWith("_Api")) { name = name.Substring(0, name.Length - 4); m_Apis[name] = t; @@ -69,7 +69,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public IScriptApi CreateApi(string api) { - if(!m_Apis.ContainsKey(api)) + if (!m_Apis.ContainsKey(api)) return null; IScriptApi ret = (IScriptApi)(Activator.CreateInstance(m_Apis[api])); diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/AsyncCommandManager.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/AsyncCommandManager.cs index 8c967a2..fcd1df8 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/AsyncCommandManager.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/AsyncCommandManager.cs @@ -95,7 +95,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public AsyncCommandManager(IScriptEngine _ScriptEngine) { m_ScriptEngine = _ScriptEngine; - if(!m_Managers.Contains(this)) + if (!m_Managers.Contains(this)) m_Managers.Add(this); ReadConfig(); diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 202fce7..57c1e02 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -2553,7 +2553,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api LLUUID destId = LLUUID.Zero; LLUUID objId = LLUUID.Zero; - if(!LLUUID.TryParse(destination, out destId)) + if (!LLUUID.TryParse(destination, out destId)) { llSay(0, "Could not parse key " + destination); return; diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs index 7b3907f..08ee203 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs @@ -46,7 +46,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase public void ApiTypeLSL(IScriptApi api) { - if(!(api is ILSL_Api)) + if (!(api is ILSL_Api)) return; m_LSL_Functions = (ILSL_Api)api; diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs index 168804d..34e2fb1 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs @@ -47,7 +47,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase public void ApiTypeOSSL(IScriptApi api) { - if(!(api is IOSSL_Api)) + if (!(api is IOSSL_Api)) return; m_OSSL_Functions = (IOSSL_Api)api; diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/ScriptBase.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/ScriptBase.cs index aa2c9c2..c12b1f8 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/ScriptBase.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/ScriptBase.cs @@ -44,9 +44,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase { MethodInfo[] myArrayMethodInfo = GetType().GetMethods(BindingFlags.Public|BindingFlags.Instance); - foreach(MethodInfo mi in myArrayMethodInfo) + foreach (MethodInfo mi in myArrayMethodInfo) { - if(mi.Name.Length > 7 && mi.Name.Substring(0, 7) == "ApiType") + if (mi.Name.Length > 7 && mi.Name.Substring(0, 7) == "ApiType") { string type=mi.Name.Substring(7); inits[type]=mi; @@ -63,7 +63,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase public void InitApi(string api, IScriptApi data) { - if(!inits.ContainsKey(api)) + if (!inits.ContainsKey(api)) return; MethodInfo mi = inits[api]; diff --git a/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs b/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs index 6b080a0..8edae6d 100644 --- a/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs +++ b/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs @@ -1476,7 +1476,7 @@ namespace OpenSim.Region.ScriptEngine.Shared public override bool Equals(Object o) { - if(!(o is LSLFloat)) + if (!(o is LSLFloat)) return false; return value == ((LSLFloat)o).value; -- cgit v1.1