--- deliantra/server/common/player.C 2006/08/29 08:01:35 1.2 +++ deliantra/server/common/player.C 2007/01/06 14:42:29 1.13 @@ -1,11 +1,7 @@ /* - * static char *rcsid_player_c = - * "$Id: player.C,v 1.2 2006/08/29 08:01:35 root Exp $"; - */ - -/* CrossFire, A Multiplayer game for X-windows + Copyright (C) 2005, 2006, 2007 Marc Lehmann & Crossfire+ Development Team Copyright (C) 2002 Mark Wedel & Crossfire Development Team Copyright (C) 1992 Frank Tore Johansen @@ -23,48 +19,24 @@ 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 #include -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 (!QUERY_FLAG(pl->ob, FLAG_REMOVED)) remove_ob(pl->ob); - free_object(pl->ob); - } - /* Clear item stack */ - if (pl->stack_items) free( pl->stack_items ); - - free(pl->socket.faces_sent); - - CFREE(pl); -} - - /* Determine if the attacktype represented by the * specified attack-number is enabled for dragon players. * A dragon player (quetzal) can gain resistances for * all enabled attacktypes. */ -int atnr_is_dragon_enabled(int attacknr) { +int +atnr_is_dragon_enabled (int attacknr) +{ if (attacknr == ATNR_MAGIC || attacknr == ATNR_FIRE || - attacknr == ATNR_ELECTRICITY || attacknr == ATNR_COLD || - attacknr == ATNR_ACID || attacknr == ATNR_POISON) + attacknr == ATNR_ELECTRICITY || attacknr == ATNR_COLD || attacknr == ATNR_ACID || attacknr == ATNR_POISON) return 1; + return 0; } @@ -72,10 +44,10 @@ * returns true if the adressed object 'ob' is a player * of the dragon race. */ -int is_dragon_pl(const object* op) { - if (op != NULL && op->type == PLAYER && op->arch != NULL - && op->arch->clone.race != NULL && - strcmp(op->arch->clone.race, "dragon")==0) +int +is_dragon_pl (const object *op) +{ + if (op != NULL && op->type == PLAYER && op->arch != NULL && op->arch->clone.race != NULL && strcmp (op->arch->clone.race, "dragon") == 0) return 1; return 0; }