From fa700bd7c3008e85d7f59f93d131cf4e20d94e2b Mon Sep 17 00:00:00 2001 From: treeform Date: Tue, 12 Jan 2010 08:19:15 +0000 Subject: [PATCH] Fixed the curve bug for real this time. Last fix to the curve just hid it. https://bugs.launchpad.net/panda3d/+bug/383969 Happy curving without segfaults! --- panda/src/parametrics/parametricCurveCollection.cxx | 4 ---- panda/src/parametrics/piecewiseCurve.cxx | 4 +++- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/panda/src/parametrics/parametricCurveCollection.cxx b/panda/src/parametrics/parametricCurveCollection.cxx index 543001ee17..0ed6ade549 100644 --- a/panda/src/parametrics/parametricCurveCollection.cxx +++ b/panda/src/parametrics/parametricCurveCollection.cxx @@ -518,10 +518,6 @@ evaluate(float t, LVecBase3f &xyz, LVecBase3f &hpr) const { } } - if (default_curve == (ParametricCurve *)NULL) { - return false; - } - if (xyz_curve == (ParametricCurve *)NULL) { xyz_curve = default_curve; } diff --git a/panda/src/parametrics/piecewiseCurve.cxx b/panda/src/parametrics/piecewiseCurve.cxx index 8d4e72f790..89d90feccf 100644 --- a/panda/src/parametrics/piecewiseCurve.cxx +++ b/panda/src/parametrics/piecewiseCurve.cxx @@ -82,7 +82,9 @@ bool PiecewiseCurve:: get_point(float t, LVecBase3f &point) const { const ParametricCurve *curve; bool result = find_curve(curve, t); - + if (curve == NULL){ + return false; + } // We use | instead of || so we won't short-circuit this calculation. return result | curve->get_point(t, point); }