diff options
author | Melanie | 2011-05-20 22:38:05 +0100 |
---|---|---|
committer | Melanie | 2011-05-20 22:38:05 +0100 |
commit | e62d1cc480ef98be5621ed809c2dd7f1e8d16dd9 (patch) | |
tree | 746085bf27044b477fc4552228b14388565421ec /OpenSim/Region/ScriptEngine/Shared | |
parent | If a response cannot be obtained (the script has no handler) return a more fr... (diff) | |
parent | Implement llGetLinKNumberOfSides(). (diff) | |
download | opensim-SC_OLD-e62d1cc480ef98be5621ed809c2dd7f1e8d16dd9.zip opensim-SC_OLD-e62d1cc480ef98be5621ed809c2dd7f1e8d16dd9.tar.gz opensim-SC_OLD-e62d1cc480ef98be5621ed809c2dd7f1e8d16dd9.tar.bz2 opensim-SC_OLD-e62d1cc480ef98be5621ed809c2dd7f1e8d16dd9.tar.xz |
Merge branch 'master' into careminster-presence-refactor
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 16 | ||||
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs | 6 |
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 | { |