… | |
… | |
125 | for (i = 0; i < SIZEOFFREE; i++) |
125 | for (i = 0; i < SIZEOFFREE; i++) |
126 | { |
126 | { |
127 | /* modified to implement smart searching using search_arr |
127 | /* modified to implement smart searching using search_arr |
128 | * guidance array to determine direction of search order |
128 | * guidance array to determine direction of search order |
129 | */ |
129 | */ |
130 | nx = npc->x + freearr_x[search_arr[i]]; |
130 | nx = npc->x + DIRX (search_arr[i]); |
131 | ny = npc->y + freearr_y[search_arr[i]]; |
131 | ny = npc->y + DIRY (search_arr[i]); |
132 | m = npc->map; |
132 | m = npc->map; |
133 | |
133 | |
134 | mflags = get_map_flags (m, &m, nx, ny, &nx, &ny); |
134 | mflags = get_map_flags (m, &m, nx, ny, &nx, &ny); |
135 | |
135 | |
136 | if (mflags & P_OUT_OF_MAP) |
136 | if (mflags & P_OUT_OF_MAP) |