Fix to recursion bug.

This commit is contained in:
Doug Pedrick 2012-09-24 16:18:27 +00:00
parent 9c1a6c3e1c
commit 9ce96bdc05

View File

@ -86,20 +86,21 @@ public class TransitionStrategy {
* @return true if a transition/nosecone was rendered
*/
protected boolean goDeep(final List<RocketComponent> theRc, boolean noseCones) {
boolean result = false;
for (RocketComponent rocketComponent : theRc) {
if (rocketComponent instanceof NoseCone) {
if (noseCones) {
return render((Transition) rocketComponent);
result |= render((Transition) rocketComponent);
}
}
else if (rocketComponent instanceof Transition && !noseCones) {
return render((Transition) rocketComponent);
result |= render((Transition) rocketComponent);
}
else if (rocketComponent.getChildCount() > 0) {
return goDeep(rocketComponent.getChildren(), noseCones);
result |= goDeep(rocketComponent.getChildren(), noseCones);
}
}
return false;
return result;
}
/**