@@ -471,7 +471,7 @@ t_direction MapManager::getNextDir2(short x, short y, t_direction_glob * dir)
471
471
return front;
472
472
}
473
473
474
- void MapManager::makeMap2 (int x, int y)
474
+ void MapManager::makeSearchMap (int x, int y)
475
475
{
476
476
bool change_flag;
477
477
@@ -488,7 +488,7 @@ void MapManager::makeMap2(int x, int y)
488
488
for (int j = 0 ; j < MAZESIZE_Y; j++) {
489
489
if (steps_map[i][j] == 65535 ) continue ;
490
490
if (j < (MAZESIZE_Y - 1 )) {
491
- if (wall[i][j].north == NOWALL ) {
491
+ if (wall[i][j].north != WALL ) {
492
492
if (steps_map[i][j + 1 ] == 65535 ) {
493
493
steps_map[i][j + 1 ] = steps_map[i][j] + 1 ;
494
494
change_flag = true ;
@@ -497,7 +497,7 @@ void MapManager::makeMap2(int x, int y)
497
497
}
498
498
499
499
if (i < (MAZESIZE_X - 1 )) {
500
- if (wall[i][j].east == NOWALL ) {
500
+ if (wall[i][j].east != WALL ) {
501
501
if (steps_map[i + 1 ][j] == 65535 ) {
502
502
steps_map[i + 1 ][j] = steps_map[i][j] + 1 ;
503
503
change_flag = true ;
@@ -506,7 +506,7 @@ void MapManager::makeMap2(int x, int y)
506
506
}
507
507
508
508
if (j > 0 ) {
509
- if (wall[i][j].south == NOWALL ) {
509
+ if (wall[i][j].south != WALL ) {
510
510
if (steps_map[i][j - 1 ] == 65535 ) {
511
511
steps_map[i][j - 1 ] = steps_map[i][j] + 1 ;
512
512
change_flag = true ;
@@ -515,7 +515,7 @@ void MapManager::makeMap2(int x, int y)
515
515
}
516
516
517
517
if (i > 0 ) {
518
- if (wall[i][j].west == NOWALL ) {
518
+ if (wall[i][j].west != WALL ) {
519
519
if (steps_map[i - 1 ][j] == 65535 ) {
520
520
steps_map[i - 1 ][j] = steps_map[i][j] + 1 ;
521
521
change_flag = true ;
@@ -527,7 +527,7 @@ void MapManager::makeMap2(int x, int y)
527
527
} while (change_flag == true );
528
528
}
529
529
530
- void MapManager::makeSearchMap (int x, int y)
530
+ void MapManager::makeMap2 (int x, int y)
531
531
{
532
532
bool change_flag;
533
533
@@ -544,7 +544,7 @@ void MapManager::makeSearchMap(int x, int y)
544
544
for (int j = 0 ; j < MAZESIZE_Y; j++) {
545
545
if (steps_map[i][j] == 65535 ) continue ;
546
546
if (j < (MAZESIZE_Y - 1 )) {
547
- if (wall[i][j].north != WALL ) {
547
+ if (wall[i][j].north == NOWALL ) {
548
548
if (steps_map[i][j + 1 ] == 65535 ) {
549
549
steps_map[i][j + 1 ] = steps_map[i][j] + 1 ;
550
550
change_flag = true ;
@@ -553,7 +553,7 @@ void MapManager::makeSearchMap(int x, int y)
553
553
}
554
554
555
555
if (i < (MAZESIZE_X - 1 )) {
556
- if (wall[i][j].east != WALL ) {
556
+ if (wall[i][j].east == NOWALL ) {
557
557
if (steps_map[i + 1 ][j] == 65535 ) {
558
558
steps_map[i + 1 ][j] = steps_map[i][j] + 1 ;
559
559
change_flag = true ;
@@ -562,7 +562,7 @@ void MapManager::makeSearchMap(int x, int y)
562
562
}
563
563
564
564
if (j > 0 ) {
565
- if (wall[i][j].south != WALL ) {
565
+ if (wall[i][j].south == NOWALL ) {
566
566
if (steps_map[i][j - 1 ] == 65535 ) {
567
567
steps_map[i][j - 1 ] = steps_map[i][j] + 1 ;
568
568
change_flag = true ;
@@ -571,7 +571,7 @@ void MapManager::makeSearchMap(int x, int y)
571
571
}
572
572
573
573
if (i > 0 ) {
574
- if (wall[i][j].west != WALL ) {
574
+ if (wall[i][j].west == NOWALL ) {
575
575
if (steps_map[i - 1 ][j] == 65535 ) {
576
576
steps_map[i - 1 ][j] = steps_map[i][j] + 1 ;
577
577
change_flag = true ;
0 commit comments