be a little more discriminating on firing ShapeChanged script events

so that we don't get them on every object construction.
0.6.0-stable
Sean Dague 2008-07-16 18:29:03 +00:00
parent a61cc1fcac
commit 58a0d0bb32
1 changed files with 12 additions and 2 deletions

View File

@ -191,7 +191,7 @@ namespace OpenSim.Region.Environment.Scenes
protected byte[] m_particleSystem = new byte[0];
protected ulong m_regionHandle;
protected LLQuaternion m_rotationOffset;
protected PrimitiveBaseShape m_shape;
protected PrimitiveBaseShape m_shape = null;
protected LLUUID m_uuid;
protected LLVector3 m_velocity;
@ -696,7 +696,17 @@ namespace OpenSim.Region.Environment.Scenes
get { return m_shape; }
set
{
bool shape_changed = false;
// TODO: this should really be restricted to the right
// set of attributes on shape change. For instance,
// changing the lighting on a shape shouldn't cause
// this.
if (m_shape != null)
shape_changed = true;
m_shape = value;
if (shape_changed)
TriggerScriptChangedEvent(Changed.SHAPE);
}
}