-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathutils.c
More file actions
47 lines (40 loc) · 809 Bytes
/
Copy pathutils.c
File metadata and controls
47 lines (40 loc) · 809 Bytes
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
44
45
46
47
/*
** utils.c for my_sokoban in /home/thibrex/delivery/PSU/PSU_2016_my_sokoban
**
** Made by Thibaut Cornolti
** Login <thibaut.cornolti@epitech.eu>
**
** Started on Tue Dec 6 16:34:08 2016 Thibaut Cornolti
** Last update Fri Dec 9 21:12:33 2016 Thibaut Cornolti
*/
#include "soko.h"
int pos_is_box(t_game *g, int x, int y)
{
int i;
i = -1;
while ((g->box)[++i].x != -1)
if (g->box[i].x == x && g->box[i].y == y)
return (1);
return (0);
}
int get_box_at_pos(t_game *g, int x, int y)
{
int i;
i = -1;
while ((g->box)[++i].x != -1)
if (g->box[i].x == x && g->box[i].y == y)
return (i);
return (-1);
}
void my_soko_exit_r(char *str)
{
endwin();
my_puterror(str);
exit(84);
}
void my_soko_exit()
{
endwin();
my_puterror("Error.\n");
exit(84);
}