Compile-time option to use A* for distribution pathfind-test
authorMarkus Armbruster <armbru@pond.sub.org>
Sat, 5 Mar 2011 15:05:26 +0000 (16:05 +0100)
committerMarkus Armbruster <armbru@pond.sub.org>
Tue, 12 Apr 2011 20:30:01 +0000 (22:30 +0200)
Just for benchmarking.

src/lib/update/finish.c

index 8fe2cb2bd3fd493c292962c77c0fd1feb1cf100e..16c9872d9fe86b799e2e2d5d87e4f19f5edc3ba4 100644 (file)
@@ -188,9 +188,15 @@ assemble_dist_paths(double *import_cost)
        if (sp->sct_own != dist->sct_own)
            continue;
 #ifdef DIST_PATH_NO_REUSE
+#if DIST_PATH_NO_REUSE == 1
        import_cost[uid] = path_find(sp->sct_dist_x, sp->sct_dist_y,
                                     sp->sct_x, sp->sct_y, dist->sct_own,
                                     MOB_MOVE);
+#else
+       path_find_from(sp->sct_dist_x, sp->sct_dist_y,
+                      dist->sct_own, MOB_MOVE);
+       import_cost[uid] = path_find_to(sp->sct_x, sp->sct_y);
+#endif
 #else
        if (sp->sct_dist_x != dx || sp->sct_dist_y != dy) {
            dx = sp->sct_dist_x;