Use visited_segment_bitarray_t for pick_connected_segment
This commit is contained in:
parent
0978fcdab4
commit
edc1f9e471
|
@ -437,11 +437,10 @@ int pick_connected_segment(object *objp, int max_depth)
|
|||
int start_seg;
|
||||
int head, tail;
|
||||
int seg_queue[QUEUE_SIZE*2];
|
||||
sbyte visited[MAX_SEGMENTS];
|
||||
sbyte depth[MAX_SEGMENTS];
|
||||
sbyte side_rand[MAX_SIDES_PER_SEGMENT];
|
||||
|
||||
memset(visited, 0, Highest_segment_index+1);
|
||||
visited_segment_bitarray_t visited;
|
||||
memset(depth, 0, Highest_segment_index+1);
|
||||
memset(seg_queue,0,QUEUE_SIZE*2);
|
||||
|
||||
|
@ -497,9 +496,9 @@ int pick_connected_segment(object *objp, int max_depth)
|
|||
|
||||
if ((wall_num == -1 || door_is_openable_by_player(segp, snrand)) && segp->children[snrand] > -1)
|
||||
{
|
||||
if (visited[segp->children[snrand]] == 0) {
|
||||
if (!visited[segp->children[snrand]]) {
|
||||
seg_queue[head++] = segp->children[snrand];
|
||||
visited[segp->children[snrand]] = 1;
|
||||
visited[segp->children[snrand]] = true;
|
||||
depth[segp->children[snrand]] = cur_depth+1;
|
||||
head &= QUEUE_SIZE-1;
|
||||
if (head > tail) {
|
||||
|
|
Loading…
Reference in a new issue