… | |
… | |
32 | { |
32 | { |
33 | player *prev = first_player; |
33 | player *prev = first_player; |
34 | |
34 | |
35 | while (prev != NULL && prev->next != NULL && prev->next != pl) |
35 | while (prev != NULL && prev->next != NULL && prev->next != pl) |
36 | prev = prev->next; |
36 | prev = prev->next; |
|
|
37 | |
37 | if (prev->next != pl) |
38 | if (prev->next != pl) |
38 | { |
39 | { |
39 | LOG (llevError, "Free_player: Can't find previous player.\n"); |
40 | LOG (llevError, "Free_player: Can't find previous player.\n"); |
40 | exit (1); |
41 | exit (1); |
41 | } |
42 | } |
|
|
43 | |
42 | prev->next = pl->next; |
44 | prev->next = pl->next; |
43 | } |
45 | } |
44 | else |
46 | else |
45 | first_player = pl->next; |
47 | first_player = pl->next; |
46 | |
48 | |
47 | if (pl->ob != NULL) |
49 | if (pl->ob) |
48 | { |
50 | { |
49 | if (!QUERY_FLAG (pl->ob, FLAG_REMOVED)) |
51 | if (!QUERY_FLAG (pl->ob, FLAG_REMOVED)) |
50 | remove_ob (pl->ob); |
52 | remove_ob (pl->ob); |
51 | free_object (pl->ob); |
53 | |
|
|
54 | pl->ob->contr = 0; |
|
|
55 | pl->ob->destroy (); |
52 | } |
56 | } |
|
|
57 | |
53 | /* Clear item stack */ |
58 | /* Clear item stack */ |
54 | if (pl->stack_items) |
59 | if (pl->stack_items) |
55 | free (pl->stack_items); |
60 | free (pl->stack_items); |
56 | |
61 | |
57 | free (pl->socket.faces_sent); |
62 | free (pl->socket.faces_sent); |