--- deliantra/server/common/anim.C 2007/01/03 00:21:34 1.14 +++ deliantra/server/common/anim.C 2007/01/19 17:50:10 1.18 @@ -1,25 +1,26 @@ /* - CrossFire, A Multiplayer game for X-windows - - Copyright (C) 2002-2003 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-2003 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 + */ /* This file contains animation related code. */ @@ -62,7 +63,7 @@ * order. */ { - Animations anim0; + animation anim0; anim0.name = "###none"; anim0.num_animations = 1; @@ -95,7 +96,7 @@ } num_animations++; - Animations anim; + animation anim; anim.name = buf + 5; anim.num = num_animations; /* for bsearch */ @@ -135,7 +136,7 @@ } static int -anim_compare (const Animations * a, const Animations * b) +anim_compare (const animation * a, const animation * b) { return strcmp (a->name, b->name); } @@ -146,19 +147,19 @@ int find_animation (const char *name) { - Animations - search, * - match; + animation search, *match; search.name = name; - match = (Animations *) bsearch (&search, &animations[0], (num_animations + 1), - sizeof (Animations), (int (*)(const void *, const void *)) anim_compare); + match = (animation *) bsearch (&search, &animations[0], (num_animations + 1), + sizeof (animation), (int (*)(const void *, const void *)) anim_compare); if (match) return match->num; + LOG (llevError, "Unable to find animation %s\n", name); + return 0; } @@ -171,7 +172,6 @@ * caller has a better idea which one it really wants to be using, * so let it pass along the right one. */ - void animate_object (object *op, int dir) { @@ -181,6 +181,7 @@ if (!op->animation_id || !NUM_ANIMATIONS (op)) { LOG (llevError, "Object %s lacks animation.\n", op->debug_desc ()); + CLEAR_FLAG (op, FLAG_ANIMATE); return; }