Day15 remove unnecessary condition
This commit is contained in:
Binary file not shown.
@@ -180,10 +180,6 @@ int can_move(object_t ***map, int rows, int columns, int x, int y, int dir[2]) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (next_object->type == BOX) {
|
if (next_object->type == BOX) {
|
||||||
if (next_object->pos[0] != x) {
|
|
||||||
return can_move(map, rows, columns, next_object->pos[0], next_object->pos[1], dir) && can_move(map, rows, columns, next_object->pos[0], next_object->pos[1] + 1, dir);
|
|
||||||
}
|
|
||||||
|
|
||||||
int can = 1;
|
int can = 1;
|
||||||
if (map[x][y] != map[next_object->pos[0]][next_object->pos[1]]) {
|
if (map[x][y] != map[next_object->pos[0]][next_object->pos[1]]) {
|
||||||
can &= can_move(map, rows, columns, next_object->pos[0], next_object->pos[1], dir);
|
can &= can_move(map, rows, columns, next_object->pos[0], next_object->pos[1], dir);
|
||||||
|
|||||||
Reference in New Issue
Block a user