From 7b4b3ba76ebf402a31db4d3132818a2e8b72d780 Mon Sep 17 00:00:00 2001 From: Anna Wiggins Date: Fri, 1 Jul 2011 11:48:49 -0400 Subject: [PATCH] Fixed the one-node tree bug --- gamedata.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/gamedata.cpp b/gamedata.cpp index 2038cf0..485fa62 100644 --- a/gamedata.cpp +++ b/gamedata.cpp @@ -125,8 +125,7 @@ float GameData::calculate_strength(Vertex* node) list visited; // Special case - a one-node tree just returns its own score! - list all_nodes = get_colour(node->colour); - if (all_nodes.size() == 1) return (float)node->score; + if (node->neighbors.empty()) return (float)node->score; return calculate_strength_r(node, 0, visited); }