Skip to content

Commit

Permalink
Tweaked parser: moved get_player_dir() call after find_start() so tha…
Browse files Browse the repository at this point in the history
…t we do not try to fetch the player direction before we actually validated the spawn position.
  • Loading branch information
Jean Teissier authored and Jean Teissier committed Aug 26, 2024
1 parent ec8c7bf commit d847b1e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions srcs/parser/parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
/* By: jteissie <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/08/15 12:12:00 by tsuchen #+# #+# */
/* Updated: 2024/08/16 19:08:45 by jteissie ### ########.fr */
/* Updated: 2024/08/26 15:48:20 by jteissie ### ########.fr */
/* */
/* ************************************************************************** */

Expand Down Expand Up @@ -56,10 +56,10 @@ t_parse_status verify_map(char **map, t_data *data)
start[1] = 0;
if (check_invalid_chars(map) == MAP_ERR)
return (MAP_ERR);
get_player_dir(data, start[0], start[1]);
fill_whitespaces(map);
if (find_start(start, map) == MAP_ERR)
return (MAP_ERR);
get_player_dir(data, start[0], start[1]);
if (check_walls(map, start[0], start[1], data->map_bound) == MAP_ERR)
return (MAP_ERR);
return (MAP_OK);
Expand Down
2 changes: 1 addition & 1 deletion srcs/parser/parser_utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
/* By: jteissie <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/08/16 18:12:37 by jteissie #+# #+# */
/* Updated: 2024/08/16 18:46:27 by jteissie ### ########.fr */
/* Updated: 2024/08/26 15:47:38 by jteissie ### ########.fr */
/* */
/* ************************************************************************** */

Expand Down

0 comments on commit d847b1e

Please sign in to comment.