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