瀏覽代碼

Fixed compilation with visual studio

Follow up to 0da7136.
Fixes # 1254.
Lemongrass3110 9 年之前
父節點
當前提交
c4390e58d5
共有 1 個文件被更改,包括 5 次插入5 次删除
  1. 5 5
      src/map/path.c

+ 5 - 5
src/map/path.c

@@ -325,11 +325,6 @@ bool path_search(struct walkpath_data *wpd, int16 m, int16 x0, int16 y0, int16 x
 
 		return false; // easy path unsuccessful
 	} else { // !(flag&1)
-		// A* (A-star) pathfinding
-		// We always use A* for finding walkpaths because it is what game client uses.
-		// Easy pathfinding cuts corners of non-walkable cells, but client always walks around it.
-		BHEAP_RESET(g_open_set);
-
 		// FIXME: This array is too small to ensure all paths shorter than MAX_WALKPATH
 		// can be found without node collision: calc_index(node1) = calc_index(node2).
 		// Figure out more proper size or another way to keep track of known nodes.
@@ -340,6 +335,11 @@ bool path_search(struct walkpath_data *wpd, int16 m, int16 x0, int16 y0, int16 x
 		int len = 0;
 		int j;
 
+		// A* (A-star) pathfinding
+		// We always use A* for finding walkpaths because it is what game client uses.
+		// Easy pathfinding cuts corners of non-walkable cells, but client always walks around it.
+		BHEAP_RESET(g_open_set);
+
 		memset(tp, 0, sizeof(tp));
 
 		// Start node