From 288996162269f163ca7b47a60209dfbe49e91fc5 Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Sat, 21 Apr 2012 03:42:54 +0100 Subject: [PATCH] Comment out spurious Body != IntPtr.Zero code after disableBody(), since disableBody() sets Body == IntPtr.Zero on all code paths. --- OpenSim/Region/Physics/OdePlugin/ODEPrim.cs | 27 +++++++++++++------- OpenSim/Region/Physics/OdePlugin/OdeScene.cs | 3 ++- 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs b/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs index cbb49ace54..3f88353453 100644 --- a/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs +++ b/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs @@ -1056,7 +1056,9 @@ Console.WriteLine("ZProcessTaints for " + Name); if (childrenPrim.Contains(prim)) return; -//Console.WriteLine("childrenPrim.Add " + prim); +// m_log.DebugFormat( +// "[ODE PRIM]: Linking prim {0} {1} to {2} {3}", prim.Name, prim.LocalID, Name, LocalID); + childrenPrim.Add(prim); foreach (OdePrim prm in childrenPrim) @@ -1194,12 +1196,14 @@ Console.WriteLine("ZProcessTaints for " + Name); //prm.childPrim = false; } } + disableBody(); - if (Body != IntPtr.Zero) - { - _parent_scene.DeactivatePrim(this); - } + // Spurious - Body == IntPtr.Zero after disableBody() +// if (Body != IntPtr.Zero) +// { +// _parent_scene.DeactivatePrim(this); +// } lock (childrenPrim) { @@ -1213,6 +1217,9 @@ Console.WriteLine("ZProcessTaints for " + Name); private void ChildDelink(OdePrim odePrim) { +// m_log.DebugFormat( +// "[ODE PRIM]: Delinking prim {0} {1} from {2} {3}", odePrim.Name, odePrim.LocalID, Name, LocalID); + // Okay, we have a delinked child.. need to rebuild the body. lock (childrenPrim) { @@ -1227,6 +1234,7 @@ Console.WriteLine("ZProcessTaints for " + Name); //prm.childPrim = false; } } + disableBody(); lock (childrenPrim) @@ -1235,10 +1243,11 @@ Console.WriteLine("ZProcessTaints for " + Name); childrenPrim.Remove(odePrim); } - if (Body != IntPtr.Zero) - { - _parent_scene.DeactivatePrim(this); - } + // Spurious - Body == IntPtr.Zero after disableBody() +// if (Body != IntPtr.Zero) +// { +// _parent_scene.DeactivatePrim(this); +// } lock (childrenPrim) { diff --git a/OpenSim/Region/Physics/OdePlugin/OdeScene.cs b/OpenSim/Region/Physics/OdePlugin/OdeScene.cs index 842ff916dc..409b27be02 100644 --- a/OpenSim/Region/Physics/OdePlugin/OdeScene.cs +++ b/OpenSim/Region/Physics/OdePlugin/OdeScene.cs @@ -2226,7 +2226,8 @@ namespace OpenSim.Region.Physics.OdePlugin /// internal void RemovePrimThreadLocked(OdePrim prim) { -//Console.WriteLine("RemovePrimThreadLocked " + prim.m_primName); +// m_log.DebugFormat("[ODE SCENE]: Removing physical prim {0} {1}", prim.Name, prim.LocalID); + lock (prim) { RemoveCollisionEventReporting(prim);