Depsgraph: Fix mistake in previous commit
authorSergey Sharybin <sergey.vfx@gmail.com>
Thu, 21 Dec 2017 11:16:12 +0000 (12:16 +0100)
committerSergey Sharybin <sergey.vfx@gmail.com>
Thu, 21 Dec 2017 11:16:12 +0000 (12:16 +0100)
source/blender/depsgraph/intern/builder/deg_builder_cycle.cc

index 783fd84fa3c49146c3aead7b38c6b14c2aa6a473..e30b9b444902882fd524fa370d5be314aa90df87 100644 (file)
@@ -106,7 +106,6 @@ void deg_graph_detect_cycles(Depsgraph *graph)
                else {
                        set_node_visited_state(node, NODE_NOT_VISITED);
                }
-               node->done = 0;
        }
 
        while (!BLI_stack_is_empty(traversal_stack)) {
@@ -118,8 +117,8 @@ void deg_graph_detect_cycles(Depsgraph *graph)
                        DepsRelation *rel = node->outlinks[i];
                        if (rel->to->type == DEG_NODE_TYPE_OPERATION) {
                                OperationDepsNode *to = (OperationDepsNode *)rel->to;
-                               eCyclicCheckVisitedState state = get_node_visited_state(node);
-                               if (state == NODE_IN_STACK) {
+                               eCyclicCheckVisitedState to_state = get_node_visited_state(to);
+                               if (to_state == NODE_IN_STACK) {
                                        printf("Dependency cycle detected:\n");
                                        printf("  '%s' depends on '%s' through '%s'\n",
                                               to->full_identifier().c_str(),
@@ -138,7 +137,7 @@ void deg_graph_detect_cycles(Depsgraph *graph)
                                        /* TODO(sergey): So called russian roulette cycle solver. */
                                        rel->flag |= DEPSREL_FLAG_CYCLIC;
                                }
-                               else if (state == NODE_NOT_VISITED) {
+                               else if (to_state == NODE_NOT_VISITED) {
                                        StackEntry new_entry;
                                        new_entry.node = to;
                                        new_entry.from = entry;