--- deliantra/server/common/arch.C 2006/12/13 03:28:42 1.31 +++ deliantra/server/common/arch.C 2007/01/15 21:06:18 1.37 @@ -1,25 +1,26 @@ /* - CrossFire, A Multiplayer game for X-windows - - Copyright (C) 2002 Mark Wedel & Crossfire Development Team - Copyright (C) 1992 Frank Tore Johansen - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - 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, 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 + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * 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 + */ #include @@ -120,18 +121,14 @@ object * get_archetype_by_skill_name (const char *skill, int type) { - archetype * - at; - - if (skill == NULL) - return NULL; + archetype *at; - for (at = first_archetype; at != NULL; at = at->next) - { + if (skill) + for (at = first_archetype; at; at = at->next) if (((type == -1) || (type == at->clone.type)) && (!strcmp (at->clone.skill, skill))) return arch_to_object (at); - } - return NULL; + + return 0; } /* similiar to above - this returns the first archetype @@ -181,7 +178,7 @@ tmpname[i] = 0; at = find_archetype_by_object_name (tmpname); - if (at != NULL) + if (at) return arch_to_object (at); } @@ -389,7 +386,6 @@ archetype::archetype () { - clone.clear (); /* to initial state other also */ CLEAR_FLAG (&clone, FLAG_FREED); /* This shouldn't matter, since copy_to */ SET_FLAG (&clone, FLAG_REMOVED); /* doesn't copy these flags... */ } @@ -578,7 +574,8 @@ LOG (llevDebug, " loading treasure...\n"); load_treasures (); - LOG (llevDebug, " done\n arch-pass 2...\n"); + LOG (llevDebug, " done\n"); + LOG (llevDebug, " arch-pass 2...\n"); second_arch_pass (thawer); LOG (llevDebug, " done\n"); #ifdef DEBUG @@ -592,7 +589,6 @@ * Creates and returns a new object which is a copy of the given archetype. * This function returns NULL on failure. */ - object * arch_to_object (archetype *at) { @@ -618,7 +614,6 @@ * Thus get_archetype() will be guaranteed to always return * an object, and never NULL. */ - object * create_singularity (const char *name) { @@ -636,7 +631,6 @@ * Finds which archetype matches the given name, and returns a new * object containing a copy of the archetype. */ - object * get_archetype (const char *name) {