The definition of the grid does not match at first sight:
int** map
char board[][SIZE]
Since both row and col are specified by the user at startup, the constant SIZE will not work well either.
int row_map = atoi(argv[1]);
int col_map = atoi(argv[2]);
Further constants like EMPTY, COLLAPSED, GOAL_ROW, GOAL_COL as well as PLAYER are not defined.
If you don't use C++ you could at least improve the handling of the grid by collecting all parameters needed for it in a structure.
For example:
typedef struct {
int rows, cols;
int** map;
} Grid;
And then use it like this:
Grid mygrid;
mygrid.rows = row_map;
mygrid.cols = col_map;
mygrid.map = malloc(mygrid.rows * sizeof(*mygrid.map));
....
BOOL move_player(Grid* board, Point* player, Point* move)
{
int new_row = player->row + move->row;
int new_col = player->col + move->col;
if (new_row < 0 || new_row >= board->rows || new_col < 0 || new_col >= board->cols) {
printf("Invalid move\n");
return FALSE;
}
if (board->map[new_row][new_col] != EMPTY) {
printf("Invalid move\n");
return FALSE;
}
}
With e.g. this definitions
typedef struct { int row, col; } Point;
typedef enum { FALSE, TRUE } BOOL;
typedef enum {NONE, EMPTY, GOAL, P1, P2} gidstate;