aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/ScriptEngine')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs16
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs6
2 files changed, 20 insertions, 2 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index 48a7953..c240edf 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -4887,6 +4887,22 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
4887 return result; 4887 return result;
4888 } 4888 }
4889 4889
4890 public LSL_Integer llGetLinkNumberOfSides(int link)
4891 {
4892 m_host.AddScriptLPS(1);
4893
4894 SceneObjectPart linkedPart;
4895
4896 if (link == ScriptBaseClass.LINK_ROOT)
4897 linkedPart = m_host.ParentGroup.RootPart;
4898 else if (link == ScriptBaseClass.LINK_THIS)
4899 linkedPart = m_host;
4900 else
4901 linkedPart = m_host.ParentGroup.GetLinkNumPart(link);
4902
4903 return GetNumberOfSides(linkedPart);
4904 }
4905
4890 public LSL_Integer llGetNumberOfSides() 4906 public LSL_Integer llGetNumberOfSides()
4891 { 4907 {
4892 m_host.AddScriptLPS(1); 4908 m_host.AddScriptLPS(1);
diff --git a/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs b/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs
index 665f4a6..6bfee91 100644
--- a/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs
@@ -1530,6 +1530,7 @@ namespace OpenSim.Region.ScriptEngine.Shared
1530 public struct LSLInteger 1530 public struct LSLInteger
1531 { 1531 {
1532 public int value; 1532 public int value;
1533 private static readonly Regex castRegex = new Regex(@"(^[ ]*0[xX][0-9A-Fa-f][0-9A-Fa-f]*)|(^[ ]*(-?|\+?)[0-9][0-9]*)");
1533 1534
1534 #region Constructors 1535 #region Constructors
1535 public LSLInteger(int i) 1536 public LSLInteger(int i)
@@ -1549,9 +1550,10 @@ namespace OpenSim.Region.ScriptEngine.Shared
1549 1550
1550 public LSLInteger(string s) 1551 public LSLInteger(string s)
1551 { 1552 {
1552 Regex r = new Regex("(^[ ]*0[xX][0-9A-Fa-f][0-9A-Fa-f]*)|(^[ ]*-?[0-9][0-9]*)"); 1553 Match m = castRegex.Match(s);
1553 Match m = r.Match(s);
1554 string v = m.Groups[0].Value; 1554 string v = m.Groups[0].Value;
1555 // Leading plus sign is allowed, but ignored
1556 v = v.Replace("+", "");
1555 1557
1556 if (v == String.Empty) 1558 if (v == String.Empty)
1557 { 1559 {