refactor: Remove redundant code in SOP.UpdatePrimFlags()

0.7.2-post-fixes
Justin Clark-Casey (justincc) 2011-10-15 02:07:05 +01:00
parent 50c340ef35
commit 63a6bc93e4
1 changed files with 21 additions and 27 deletions

View File

@ -4415,9 +4415,7 @@ namespace OpenSim.Region.Framework.Scenes
if (ParentGroup.Scene == null) if (ParentGroup.Scene == null)
return; return;
PhysicsActor pa = PhysActor; if (PhysActor == null)
if (pa == null)
{ {
// It's not phantom anymore. So make sure the physics engine get's knowledge of it // It's not phantom anymore. So make sure the physics engine get's knowledge of it
PhysActor = m_parentGroup.Scene.PhysicsScene.AddPrimShape( PhysActor = m_parentGroup.Scene.PhysicsScene.AddPrimShape(
@ -4429,9 +4427,6 @@ namespace OpenSim.Region.Framework.Scenes
UsePhysics, UsePhysics,
m_localId); m_localId);
pa = PhysActor;
if (pa != null)
{
PhysActor.SetMaterial(Material); PhysActor.SetMaterial(Material);
DoPhysicsPropertyUpdate(UsePhysics, true); DoPhysicsPropertyUpdate(UsePhysics, true);
@ -4457,10 +4452,9 @@ namespace OpenSim.Region.Framework.Scenes
PhysActor.SubscribeEvents(1000); PhysActor.SubscribeEvents(1000);
} }
} }
}
else // it already has a physical representation else // it already has a physical representation
{ {
pa.IsPhysical = UsePhysics; PhysActor.IsPhysical = UsePhysics;
DoPhysicsPropertyUpdate(UsePhysics, false); // Update physical status. If it's phantom this will remove the prim DoPhysicsPropertyUpdate(UsePhysics, false); // Update physical status. If it's phantom this will remove the prim