Fix an infinite recursion caused by checking the wrong values for

Buoyancy, Force and Torque
avinationmerge
Melanie 2012-02-26 13:22:17 +01:00
parent aa552d0526
commit 9a15bba99b
1 changed files with 27 additions and 24 deletions

View File

@ -1306,19 +1306,20 @@ namespace OpenSim.Region.Framework.Scenes
{ {
get get
{ {
if (ParentID != 0 && ParentGroup != null) if (ParentGroup.RootPart == this)
m_buoyancy = ParentGroup.RootPart.Buoyancy; return m_buoyancy;
return m_buoyancy;
return ParentGroup.RootPart.Buoyancy;
} }
set set
{ {
m_buoyancy = value; if (ParentGroup.RootPart != this)
if (ParentID != 0)
{ {
if (ParentGroup != null) ParentGroup.RootPart.Buoyancy = value;
ParentGroup.RootPart.Buoyancy = value; return;
} }
else if (PhysActor != null) m_buoyancy = value;
if (PhysActor != null)
PhysActor.Buoyancy = value; PhysActor.Buoyancy = value;
} }
} }
@ -1327,20 +1328,21 @@ namespace OpenSim.Region.Framework.Scenes
{ {
get get
{ {
if (ParentID != 0 && ParentGroup != null) if (ParentGroup.RootPart == this)
m_force = ParentGroup.RootPart.Force; return m_force;
return m_force;
return ParentGroup.RootPart.Force;
} }
set set
{ {
m_force = value; if (ParentGroup.RootPart != this)
if (ParentID != 0)
{ {
if (ParentGroup != null) ParentGroup.RootPart.Force = value;
ParentGroup.RootPart.Force = value; return;
} }
else if (PhysActor != null) m_force = value;
if (PhysActor != null)
PhysActor.Force = value; PhysActor.Force = value;
} }
} }
@ -1349,20 +1351,21 @@ namespace OpenSim.Region.Framework.Scenes
{ {
get get
{ {
if (ParentID != 0 && ParentGroup != null) if (ParentGroup.RootPart == this)
m_torque = ParentGroup.RootPart.Torque; return m_torque;
return m_torque;
return ParentGroup.RootPart.Torque;
} }
set set
{ {
m_torque = value; if (ParentGroup.RootPart != this)
if (ParentID != 0)
{ {
if (ParentGroup != null) ParentGroup.RootPart.Torque = value;
ParentGroup.RootPart.Torque = value; return;
} }
else if (PhysActor != null) m_torque = value;
if (PhysActor != null)
PhysActor.Torque = value; PhysActor.Torque = value;
} }
} }