--- deliantra/server/common/image.C 2007/03/14 00:04:58 1.20 +++ deliantra/server/common/image.C 2007/07/16 14:09:40 1.27 @@ -1,28 +1,26 @@ /* - * CrossFire, A Multiplayer game + * This file is part of Crossfire TRT, the Roguelike Realtime MORPG. * - * Copyright (C) 2005, 2006, 2007 Marc Lehmann & Crossfire+ Development Team - * Copyright (C) 2002 Mark Wedel & Crossfire Development Team - * Copyright (C) 1992 Frank Tore Johansen + * Copyright (©) 2005,2006,2007 Marc Alexander Lehmann / Robin Redeker / the Crossfire TRT team + * Copyright (©) 2002,2007 Mark Wedel & Crossfire Development Team + * Copyright (©) 1992,2007 Frank Tore Johansen * - * This program is free software; you can redistribute it and/or modify + * Crossfire TRT 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 + * the Free Software Foundation, either version 3 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 + * 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 maintainer of this code can be reached at + * along with this program. If not, see . + * + * The authors can be reached via e-mail to */ - #include #include @@ -77,6 +75,9 @@ faceidx face_find (const char *name, faceidx defidx) { + if (!name) + return defidx; + facehash_t::iterator i = facehash.find (name); return i == facehash.end () @@ -86,6 +87,8 @@ faceinfo * face_info (faceidx idx) { + assert (0 < (faceidx)-1); // faceidx must be unsigned + if (idx >= faces.size ()) return 0; @@ -96,7 +99,7 @@ face_data (faceidx idx, int faceset) { if (faceinfo *f = face_info (idx)) - return &(faceset ? f->data32 : f->data64); + return &(faceset && !f->type && f->data64.data.size () ? f->data64 : f->data32); return 0; }