mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 02:15:43 -04:00
fix bug causing runaway recursion
This commit is contained in:
parent
2a8ae9abcc
commit
ccc5dc547c
@ -3717,9 +3717,16 @@ void NodePath::
|
|||||||
r_find_matches(NodePathCollection &result,
|
r_find_matches(NodePathCollection &result,
|
||||||
const FindApproxLevel &level,
|
const FindApproxLevel &level,
|
||||||
int max_matches, int num_levels_remaining) const {
|
int max_matches, int num_levels_remaining) const {
|
||||||
|
if (pgraph_cat.is_debug()) {
|
||||||
|
pgraph_cat.debug()
|
||||||
|
<< "r_find_matches(" << result << ", level, "
|
||||||
|
<< max_matches << ", " << num_levels_remaining << ")\n";
|
||||||
|
level.write(pgraph_cat.debug(false));
|
||||||
|
}
|
||||||
|
|
||||||
// Go on to the next level. If we exceeded the requested maximum
|
// Go on to the next level. If we exceeded the requested maximum
|
||||||
// depth, stop.
|
// depth (or if there are no more levels to visit), stop.
|
||||||
if (num_levels_remaining <= 0) {
|
if (num_levels_remaining <= 0 || level._v.empty()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
num_levels_remaining--;
|
num_levels_remaining--;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user