Merge branch 'master' into careminster-presence-refactor

This commit is contained in:
Melanie
2011-05-20 22:38:05 +01:00
14 changed files with 186 additions and 45 deletions

View File

@@ -4887,6 +4887,22 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
return result;
}
public LSL_Integer llGetLinkNumberOfSides(int link)
{
m_host.AddScriptLPS(1);
SceneObjectPart linkedPart;
if (link == ScriptBaseClass.LINK_ROOT)
linkedPart = m_host.ParentGroup.RootPart;
else if (link == ScriptBaseClass.LINK_THIS)
linkedPart = m_host;
else
linkedPart = m_host.ParentGroup.GetLinkNumPart(link);
return GetNumberOfSides(linkedPart);
}
public LSL_Integer llGetNumberOfSides()
{
m_host.AddScriptLPS(1);

View File

@@ -1530,6 +1530,7 @@ namespace OpenSim.Region.ScriptEngine.Shared
public struct LSLInteger
{
public int value;
private static readonly Regex castRegex = new Regex(@"(^[ ]*0[xX][0-9A-Fa-f][0-9A-Fa-f]*)|(^[ ]*(-?|\+?)[0-9][0-9]*)");
#region Constructors
public LSLInteger(int i)
@@ -1549,9 +1550,10 @@ namespace OpenSim.Region.ScriptEngine.Shared
public LSLInteger(string s)
{
Regex r = new Regex("(^[ ]*0[xX][0-9A-Fa-f][0-9A-Fa-f]*)|(^[ ]*-?[0-9][0-9]*)");
Match m = r.Match(s);
Match m = castRegex.Match(s);
string v = m.Groups[0].Value;
// Leading plus sign is allowed, but ignored
v = v.Replace("+", "");
if (v == String.Empty)
{