Fixed the one-node tree bug
This commit is contained in:
parent
ec2b513fe5
commit
7b4b3ba76e
|
@ -125,8 +125,7 @@ float GameData::calculate_strength(Vertex* node)
|
|||
list<Vertex*> visited;
|
||||
|
||||
// Special case - a one-node tree just returns its own score!
|
||||
list<Vertex*> 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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user