-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patherror.c
More file actions
43 lines (38 loc) · 1.5 KB
/
Copy patherror.c
File metadata and controls
43 lines (38 loc) · 1.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* error.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: brheaume <marvin@42quebec.com> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/04/11 16:26:20 by brheaume #+# #+# */
/* Updated: 2023/05/01 14:57:28 by brheaume ### ########.fr */
/* */
/* ************************************************************************** */
#include "so_long.h"
void ft_error_simple(char *message)
{
ft_putendl_fd("Error:", ERROR_OUTPUT);
ft_putendl_fd(message, ERROR_OUTPUT);
exit(EXIT_FAILURE);
}
void ft_error_map(char **map)
{
ft_clear_array(map);
ft_putendl_fd("Error\nInvalid map content", ERROR_OUTPUT);
exit(EXIT_FAILURE);
}
void ft_error_game(t_data *game)
{
ft_clear_array(game->map);
mlx_terminate(game->mlx);
ft_putendl_fd("Error\nGame did an oopsie daisy", ERROR_OUTPUT);
exit(EXIT_FAILURE);
}
void ft_error_interrupt(t_data *game)
{
ft_clear_array(game->map);
mlx_terminate(game->mlx);
ft_putendl_fd("Interrupted!", ERROR_OUTPUT);
exit(EXIT_FAILURE);
}