--- deliantra/server/common/player.C 2006/09/10 16:00:23 1.4 +++ deliantra/server/common/player.C 2006/12/14 04:30:32 1.9 @@ -1,9 +1,3 @@ - -/* - * static char *rcsid_player_c = - * "$Id: player.C,v 1.4 2006/09/10 16:00:23 root Exp $"; - */ - /* CrossFire, A Multiplayer game for X-windows @@ -24,7 +18,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - The authors can be reached via e-mail at crossfire-devel@real-time.com + The authors can be reached via e-mail at */ #include @@ -33,34 +27,36 @@ void free_player (player *pl) { - if (first_player != pl) { player *prev = first_player; while (prev != NULL && prev->next != NULL && prev->next != pl) prev = prev->next; + if (prev->next != pl) { LOG (llevError, "Free_player: Can't find previous player.\n"); exit (1); } + prev->next = pl->next; } else first_player = pl->next; - if (pl->ob != NULL) + if (pl->ob) { - if (!QUERY_FLAG (pl->ob, FLAG_REMOVED)) - remove_ob (pl->ob); - free_object (pl->ob); + pl->ob->contr = 0; + pl->ob->destroy (); } + /* Clear item stack */ if (pl->stack_items) free (pl->stack_items); - free (pl->socket.faces_sent); + pl->socket->status = Ns_Dead; + pl->socket->pl = 0; delete pl; }