}
} else if (pf_dst_tile->z == 0) { log_error("Invalid Destination Height @ %d, %d!\n", x, y); return 0; }
int pf_find_path(int x, int y){	actor *me = pf_get_our_actor();	int i;		pf_destroy_path();		if (me == NULL) {		return -1;	}		pf_src_tile = pf_get_tile(me->x_tile_pos, me->y_tile_pos);	pf_dst_tile = pf_get_tile(x, y);		if (!pf_dst_tile || pf_dst_tile->z == 0) {        log_error("Invalid Destination!\n");		return 0;	}		for (i = 0; i < tile_map_size_x*tile_map_size_y*6*6; i++) {		pf_tile_map[i].state = PF_STATE_NONE;		pf_tile_map[i].parent = NULL;	}	pf_open.tiles = (PF_TILE **)calloc(tile_map_size_x*tile_map_size_y*6*6, sizeof(PF_TILE*));	pf_open.count = 0;		pf_add_tile_to_open_list(NULL, pf_src_tile);		while ((pf_cur_tile = pf_get_next_open_tile())) {		if (pf_cur_tile == pf_dst_tile) {			pf_follow_path = 1;			break;		}				pf_add_tile_to_open_list(pf_cur_tile, pf_get_tile(pf_cur_tile->x, pf_cur_tile->y+1));		pf_add_tile_to_open_list(pf_cur_tile, pf_get_tile(pf_cur_tile->x+1, pf_cur_tile->y+1));		pf_add_tile_to_open_list(pf_cur_tile, pf_get_tile(pf_cur_tile->x+1, pf_cur_tile->y));		pf_add_tile_to_open_list(pf_cur_tile, pf_get_tile(pf_cur_tile->x+1, pf_cur_tile->y-1));		pf_add_tile_to_open_list(pf_cur_tile, pf_get_tile(pf_cur_tile->x, pf_cur_tile->y-1));		pf_add_tile_to_open_list(pf_cur_tile, pf_get_tile(pf_cur_tile->x-1, pf_cur_tile->y-1));		pf_add_tile_to_open_list(pf_cur_tile, pf_get_tile(pf_cur_tile->x-1, pf_cur_tile->y));		pf_add_tile_to_open_list(pf_cur_tile, pf_get_tile(pf_cur_tile->x-1, pf_cur_tile->y+1));	}		free(pf_open.tiles);		return pf_follow_path;}