From fb4067c84493582bd3897eb7aee846c19bf334af Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Wed, 15 Jul 2009 00:10:01 +0000 Subject: A stab at implementing llSetDamage. Not persistent. --- OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 6 ++++++ OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 9 +++++++++ OpenSim/Region/Framework/Scenes/ScenePresence.cs | 7 ++++++- 3 files changed, 21 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region/Framework/Scenes') diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index 31b94d9..d65dbaf 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs @@ -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; } diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index dd00ff4..a4d455c 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -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; } + } + /// /// The position of the entire group that this prim belongs to. /// diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index b85a138..56369f5 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -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) { -- cgit v1.1