diff options
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared')
3 files changed, 20 insertions, 3 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 0240227..1cf03b8 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -4458,6 +4458,22 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
4458 | return result; | 4458 | return result; |
4459 | } | 4459 | } |
4460 | 4460 | ||
4461 | public LSL_Integer llGetLinkNumberOfSides(int link) | ||
4462 | { | ||
4463 | m_host.AddScriptLPS(1); | ||
4464 | |||
4465 | SceneObjectPart linkedPart; | ||
4466 | |||
4467 | if (link == ScriptBaseClass.LINK_ROOT) | ||
4468 | linkedPart = m_host.ParentGroup.RootPart; | ||
4469 | else if (link == ScriptBaseClass.LINK_THIS) | ||
4470 | linkedPart = m_host; | ||
4471 | else | ||
4472 | linkedPart = m_host.ParentGroup.GetLinkNumPart(link); | ||
4473 | |||
4474 | return GetNumberOfSides(linkedPart); | ||
4475 | } | ||
4476 | |||
4461 | public LSL_Integer llGetNumberOfSides() | 4477 | public LSL_Integer llGetNumberOfSides() |
4462 | { | 4478 | { |
4463 | m_host.AddScriptLPS(1); | 4479 | m_host.AddScriptLPS(1); |
diff --git a/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs b/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs index 298d664..461b473 100644 --- a/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs +++ b/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs | |||
@@ -1536,6 +1536,7 @@ namespace OpenSim.Region.ScriptEngine.Shared | |||
1536 | public struct LSLInteger | 1536 | public struct LSLInteger |
1537 | { | 1537 | { |
1538 | public int value; | 1538 | public int value; |
1539 | private static readonly Regex castRegex = new Regex(@"(^[ ]*0[xX][0-9A-Fa-f][0-9A-Fa-f]*)|(^[ ]*(-?|\+?)[0-9][0-9]*)"); | ||
1539 | 1540 | ||
1540 | #region Constructors | 1541 | #region Constructors |
1541 | public LSLInteger(int i) | 1542 | public LSLInteger(int i) |
@@ -1555,9 +1556,10 @@ namespace OpenSim.Region.ScriptEngine.Shared | |||
1555 | 1556 | ||
1556 | public LSLInteger(string s) | 1557 | public LSLInteger(string s) |
1557 | { | 1558 | { |
1558 | Regex r = new Regex("(^[ ]*0[xX][0-9A-Fa-f][0-9A-Fa-f]*)|(^[ ]*-?[0-9][0-9]*)"); | 1559 | Match m = castRegex.Match(s); |
1559 | Match m = r.Match(s); | ||
1560 | string v = m.Groups[0].Value; | 1560 | string v = m.Groups[0].Value; |
1561 | // Leading plus sign is allowed, but ignored | ||
1562 | v = v.Replace("+", ""); | ||
1561 | 1563 | ||
1562 | if (v == String.Empty) | 1564 | if (v == String.Empty) |
1563 | { | 1565 | { |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiTest.cs b/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiTest.cs index 1d55b95..80b60a4 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiTest.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiTest.cs | |||
@@ -29,7 +29,6 @@ using System.Collections.Generic; | |||
29 | using NUnit.Framework; | 29 | using NUnit.Framework; |
30 | using OpenSim.Tests.Common; | 30 | using OpenSim.Tests.Common; |
31 | using OpenSim.Region.ScriptEngine.Shared; | 31 | using OpenSim.Region.ScriptEngine.Shared; |
32 | using OpenSim.Tests.Common.Setup; | ||
33 | using OpenSim.Region.Framework.Scenes; | 32 | using OpenSim.Region.Framework.Scenes; |
34 | using Nini.Config; | 33 | using Nini.Config; |
35 | using OpenSim.Region.ScriptEngine.Shared.Api; | 34 | using OpenSim.Region.ScriptEngine.Shared.Api; |