A stab at implementing llSetDamage. Not persistent.

trunk
Melanie Thielker 2009-07-15 00:10:01 +00:00
parent 750f75c514
commit fb4067c844
4 changed files with 22 additions and 2 deletions

View File

@ -326,6 +326,12 @@ namespace OpenSim.Region.Framework.Scenes
set { m_rootPart.OwnerID = value; } set { m_rootPart.OwnerID = value; }
} }
public float Damage
{
get { return m_rootPart.Damage; }
set { m_rootPart.Damage = value; }
}
public Color Color public Color Color
{ {
get { return m_rootPart.Color; } get { return m_rootPart.Color; }

View File

@ -195,6 +195,8 @@ namespace OpenSim.Region.Framework.Scenes
[XmlIgnore] [XmlIgnore]
private PrimFlags LocalFlags = 0; private PrimFlags LocalFlags = 0;
[XmlIgnore]
private float m_damage = -1.0f;
private byte[] m_TextureAnimation; private byte[] m_TextureAnimation;
private byte m_clickAction = 0; private byte m_clickAction = 0;
private Color m_color = Color.Black; private Color m_color = Color.Black;
@ -484,6 +486,13 @@ namespace OpenSim.Region.Framework.Scenes
set { m_rezzed = value; } set { m_rezzed = value; }
} }
[XmlIgnore]
public float Damage
{
get { return m_damage; }
set { m_damage = value; }
}
/// <summary> /// <summary>
/// The position of the entire group that this prim belongs to. /// The position of the entire group that this prim belongs to.
/// </summary> /// </summary>

View File

@ -3230,7 +3230,12 @@ namespace OpenSim.Region.Framework.Scenes
//if (localid == 0) //if (localid == 0)
//continue; //continue;
Health -= coldata[localid] * 5; SceneObjectPart part = m_scene.GetSceneObjectPart(localid);
if (part != null && part.ParentGroup.Damage != -1.0f)
Health -= part.ParentGroup.Damage;
else
Health -= coldata[localid] * 5;
if (Health <= 0) if (Health <= 0)
{ {

View File

@ -3833,7 +3833,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
public void llSetDamage(double damage) public void llSetDamage(double damage)
{ {
m_host.AddScriptLPS(1); m_host.AddScriptLPS(1);
NotImplemented("llSetDamage"); m_host.ParentGroup.Damage = (float)damage;
} }
public void llTeleportAgentHome(string agent) public void llTeleportAgentHome(string agent)