diff --git a/panda/src/collide/collisionNode.cxx b/panda/src/collide/collisionNode.cxx index c2f8fb3564..ff87e6d696 100644 --- a/panda/src/collide/collisionNode.cxx +++ b/panda/src/collide/collisionNode.cxx @@ -153,9 +153,12 @@ combine_with(Node *other) { mark_bound_stale(); return this; } + + // Two CollisionNodes with different names can't combine. + return (Node *)NULL; } - return (Node *)NULL; + return NamedNode::combine_with(other); } //////////////////////////////////////////////////////////////////// diff --git a/panda/src/graph/namedNode.cxx b/panda/src/graph/namedNode.cxx index 8b094e1266..d215683ed0 100644 --- a/panda/src/graph/namedNode.cxx +++ b/panda/src/graph/namedNode.cxx @@ -75,10 +75,14 @@ combine_with(Node *other) { } // The other node is also a NamedNode, or better, so it wins. return other; + + } else if (other->is_exact_type(get_class_type())) { + // We're not an ordinary NamedNode, but the other one is. + return this; } // We're something other than an ordinary NamedNode. Don't combine. - return (Node *)NULL; + return Node::combine_with(other); } //////////////////////////////////////////////////////////////////// diff --git a/panda/src/graph/node.cxx b/panda/src/graph/node.cxx index 75d2a7be6c..b50b02cee3 100644 --- a/panda/src/graph/node.cxx +++ b/panda/src/graph/node.cxx @@ -208,6 +208,10 @@ combine_with(Node *other) { if (is_exact_type(get_class_type())) { // No, we're an ordinary Node. return other; + + } else if (other->is_exact_type(get_class_type())) { + // We're not an ordinary Node, but the other one is. + return this; } // We're something other than an ordinary Node. Don't combine. diff --git a/panda/src/sgraph/geomNode.cxx b/panda/src/sgraph/geomNode.cxx index e493d83a12..1493c49273 100644 --- a/panda/src/sgraph/geomNode.cxx +++ b/panda/src/sgraph/geomNode.cxx @@ -136,7 +136,7 @@ combine_with(Node *other) { return this; } - return (Node *)NULL; + return NamedNode::combine_with(other); } ////////////////////////////////////////////////////////////////////