diff --git a/CONTRIBUTORS b/CONTRIBUTORS index c85c3ae31..ce1c41866 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -66,6 +66,7 @@ David Allison Tsung-Han Yu Piotr Kubowicz RumovZ +Cecini ******************** diff --git a/rslib/src/decks/tree.rs b/rslib/src/decks/tree.rs index d42015180..b60d7b794 100644 --- a/rslib/src/decks/tree.rs +++ b/rslib/src/decks/tree.rs @@ -175,9 +175,12 @@ fn hide_default_deck(node: &mut DeckTreeNode) { } fn get_subnode(top: DeckTreeNode, target: DeckID) -> Option { + if top.deck_id == target.0 { + return Some(top); + } for child in top.children { - if child.deck_id == target.0 { - return Some(child); + if let Some(node) = get_subnode(child, target) { + return Some(node); } }