Improve parsing of joint parameters for NINJA physics (Mantis #2966).

Multiple spaces or leading/trailing spaces when specifying the prims 
to connect should no longer cause problems.
0.6.2-post-fixes
nlin 2009-01-14 04:59:57 +00:00
parent 866c85be0d
commit bfdf2479fb
2 changed files with 2 additions and 2 deletions

View File

@ -1470,7 +1470,7 @@ if (m_shape != null) {
List<string> bodyNames = new List<string>(); List<string> bodyNames = new List<string>();
string RawParams = Description; string RawParams = Description;
string[] jointParams = RawParams.Split(' '); string[] jointParams = RawParams.Split(" ".ToCharArray(), System.StringSplitOptions.RemoveEmptyEntries);
string trackedBodyName = null; string trackedBodyName = null;
if (jointParams.Length >= 2) if (jointParams.Length >= 2)
{ {

View File

@ -2318,7 +2318,7 @@ namespace OpenSim.Region.Physics.OdePlugin
foreach (PhysicsJoint joint in pendingJoints) foreach (PhysicsJoint joint in pendingJoints)
{ {
//DoJointErrorMessage(joint, "taint: time to create joint with parms: " + joint.RawParams); //DoJointErrorMessage(joint, "taint: time to create joint with parms: " + joint.RawParams);
string[] jointParams = joint.RawParams.Split(' '); string[] jointParams = joint.RawParams.Split(" ".ToCharArray(), System.StringSplitOptions.RemoveEmptyEntries);
List<IntPtr> jointBodies = new List<IntPtr>(); List<IntPtr> jointBodies = new List<IntPtr>();
bool allJointBodiesAreReady = true; bool allJointBodiesAreReady = true;
foreach (string jointParam in jointParams) foreach (string jointParam in jointParams)