- avoid divide by zero with node progress
authorCampbell Barton <ideasman42@gmail.com>
Wed, 23 Jun 2010 15:07:20 +0000 (15:07 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Wed, 23 Jun 2010 15:07:20 +0000 (15:07 +0000)
- write_crash_blend() was writing to the original path.

source/blender/blenkernel/intern/node.c
source/blender/windowmanager/intern/wm_files.c

index 13ea55e..add011d 100644 (file)
@@ -2465,7 +2465,7 @@ void ntreeCompositExecTree(bNodeTree *ntree, RenderData *rd, int do_preview)
                        node= getExecutableNode(ntree);
                        if(node) {
                                
-                               if(ntree->progress)
+                               if(ntree->progress && totnode)
                                        ntree->progress(ntree->prh, (1.0 - curnode/(float)totnode));
                                if(ntree->stats_draw) {
                                        char str[64];
index 93fe5e5..1357b96 100644 (file)
@@ -539,7 +539,7 @@ int write_crash_blend(void)
        char path[FILE_MAX];
        BLI_strncpy(path, G.sce, sizeof(path));
        BLI_replace_extension(path, sizeof(path), "_crash.blend");
-       if(BLO_write_file(G.main, G.sce, G.fileflags, NULL, NULL)) {
+       if(BLO_write_file(G.main, path, G.fileflags, NULL, NULL)) {
                printf("written: %s\n", path);
                return 1;
        }