refactor: Fold most SOP.ScriptSet* methods back into script code. Simplify.

bulletsim
Justin Clark-Casey (justincc) 2011-08-06 00:13:08 +01:00
parent ba89fc3aa1
commit c6c91e6599
3 changed files with 9 additions and 47 deletions

View File

@ -2967,22 +2967,6 @@ namespace OpenSim.Region.Framework.Scenes
}
}
public void ScriptSetPhantomStatus(bool Phantom)
{
if (m_parentGroup != null)
{
m_parentGroup.ScriptSetPhantomStatus(Phantom);
}
}
public void ScriptSetTemporaryStatus(bool Temporary)
{
if (m_parentGroup != null)
{
m_parentGroup.ScriptSetTemporaryStatus(Temporary);
}
}
public void ScriptSetPhysicsStatus(bool UsePhysics)
{
if (m_parentGroup == null)
@ -2991,15 +2975,6 @@ namespace OpenSim.Region.Framework.Scenes
m_parentGroup.ScriptSetPhysicsStatus(UsePhysics);
}
public void ScriptSetVolumeDetect(bool SetVD)
{
if (m_parentGroup != null)
{
m_parentGroup.ScriptSetVolumeDetect(SetVD);
}
}
/// <summary>
/// Set sculpt and mesh data, and tell the physics engine to process the change.
/// </summary>

View File

@ -53,9 +53,9 @@ namespace OpenSim.Region.Framework.Scenes.Tests
SceneObjectPart rootPart = so.RootPart;
Assert.That(rootPart.Flags, Is.EqualTo(PrimFlags.None));
so.RootPart.ScriptSetPhantomStatus(true);
so.ScriptSetPhantomStatus(true);
Console.WriteLine("so.RootPart.Flags [{0}]", so.RootPart.Flags);
// Console.WriteLine("so.RootPart.Flags [{0}]", so.RootPart.Flags);
Assert.That(rootPart.Flags, Is.EqualTo(PrimFlags.Phantom));
}
}

View File

@ -1204,10 +1204,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
if ((status & ScriptBaseClass.STATUS_PHANTOM) == ScriptBaseClass.STATUS_PHANTOM)
{
if (value != 0)
m_host.ScriptSetPhantomStatus(true);
else
m_host.ScriptSetPhantomStatus(false);
if (m_host.ParentGroup != null)
m_host.ParentGroup.ScriptSetPhantomStatus(value != 0);
}
if ((status & ScriptBaseClass.STATUS_CAST_SHADOWS) == ScriptBaseClass.STATUS_CAST_SHADOWS)
@ -6446,9 +6444,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
if (m_host.ParentGroup != null)
{
if (!m_host.ParentGroup.IsDeleted)
{
m_host.ParentGroup.RootPart.ScriptSetVolumeDetect(detect!=0);
}
m_host.ParentGroup.ScriptSetVolumeDetect(detect != 0);
}
}
@ -6456,7 +6452,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
/// This is a depecated function so this just replicates the result of
/// invoking it in SL
/// </summary>
public void llRemoteLoadScript(string target, string name, int running, int start_param)
{
m_host.AddScriptLPS(1);
@ -7254,14 +7249,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
return;
string ph = rules.Data[idx++].ToString();
bool phantom;
if (ph.Equals("1"))
phantom = true;
else
phantom = false;
if (m_host.ParentGroup != null)
m_host.ParentGroup.ScriptSetPhantomStatus(ph.Equals("1"));
part.ScriptSetPhantomStatus(phantom);
break;
case (int)ScriptBaseClass.PRIM_PHYSICS:
@ -7282,14 +7273,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
if (remain < 1)
return;
string temp = rules.Data[idx++].ToString();
bool tempOnRez;
if (temp.Equals("1"))
tempOnRez = true;
else
tempOnRez = false;
if (m_host.ParentGroup != null)
m_host.ParentGroup.ScriptSetTemporaryStatus(temp.Equals("1"));
part.ScriptSetTemporaryStatus(tempOnRez);
break;
case (int)ScriptBaseClass.PRIM_TEXGEN: