A stab at implementing llSetDamage. Not persistent.
parent
750f75c514
commit
fb4067c844
|
@ -326,6 +326,12 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
set { m_rootPart.OwnerID = value; }
|
||||
}
|
||||
|
||||
public float Damage
|
||||
{
|
||||
get { return m_rootPart.Damage; }
|
||||
set { m_rootPart.Damage = value; }
|
||||
}
|
||||
|
||||
public Color Color
|
||||
{
|
||||
get { return m_rootPart.Color; }
|
||||
|
|
|
@ -195,6 +195,8 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
|
||||
[XmlIgnore]
|
||||
private PrimFlags LocalFlags = 0;
|
||||
[XmlIgnore]
|
||||
private float m_damage = -1.0f;
|
||||
private byte[] m_TextureAnimation;
|
||||
private byte m_clickAction = 0;
|
||||
private Color m_color = Color.Black;
|
||||
|
@ -484,6 +486,13 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
set { m_rezzed = value; }
|
||||
}
|
||||
|
||||
[XmlIgnore]
|
||||
public float Damage
|
||||
{
|
||||
get { return m_damage; }
|
||||
set { m_damage = value; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The position of the entire group that this prim belongs to.
|
||||
/// </summary>
|
||||
|
|
|
@ -3230,7 +3230,12 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
//if (localid == 0)
|
||||
//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)
|
||||
{
|
||||
|
|
|
@ -3833,7 +3833,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
|||
public void llSetDamage(double damage)
|
||||
{
|
||||
m_host.AddScriptLPS(1);
|
||||
NotImplemented("llSetDamage");
|
||||
m_host.ParentGroup.Damage = (float)damage;
|
||||
}
|
||||
|
||||
public void llTeleportAgentHome(string agent)
|
||||
|
|
Loading…
Reference in New Issue