Project

General

Profile

Revision 311

multiplayer initial

View differences:

proj_func.c
27 27

  
28 28
static keys_t key_presses;
29 29

  
30
void host_info_dtor(host_info_t *p) {
31
    if (p==NULL) return;
32

  
33
    if ((p->bullets_x) != NULL){ free(p->bullets_x); p->bullets_x = NULL; }
34

  
35
    if ((p->bullets_y) != NULL){ free(p->bullets_y); p->bullets_y = NULL; }
36

  
37
    if ((p->bullets_vx) != NULL){ free(p->bullets_vx); p->bullets_vx = NULL; }
38

  
39
    if ((p->bullets_vy) != NULL){ free(p->bullets_vy); p->bullets_vy = NULL; }
40

  
41
    if ((p->bullets_shooter) != NULL){ free(p->bullets_shooter); p->bullets_shooter = NULL; }
42

  
43
    free(p);
44
}
45

  
46
void remote_info_dtor(remote_info_t *p) {
47
    if (p==NULL) return;
48

  
49
    if ((p->bullets_x) != NULL){ free(p->bullets_x); p->bullets_x = NULL; }
50

  
51
    if ((p->bullets_y) != NULL){ free(p->bullets_y); p->bullets_y = NULL; }
52

  
53
    if ((p->bullets_angle) != NULL){ free(p->bullets_angle); p->bullets_angle = NULL; }
54

  
55
    free(p);
56
}
57

  
30 58
void update_key_presses(void) {
31 59
    if (sz == 1) {
32 60
        switch(scancode[0]) {

Also available in: Unified diff