--- deliantra/server/common/loader.C 2007/05/17 14:14:54 1.82 +++ deliantra/server/common/loader.C 2007/05/28 21:21:40 1.86 @@ -1,25 +1,25 @@ /* - * CrossFire, A Multiplayer game + * This file is part of Crossfire TRT, the Multiplayer Online Role Playing Game. * - * 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 - * 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. + * 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 (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. + * 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 + * You should have received a copy of the GNU General Public License along + * with Crossfire TRT; if not, write to the Free Software Foundation, Inc. 51 + * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * The authors can be reached via e-mail to */ /* Eneq(@csd.uu.se): Added weight-modifiers in environment of objects. @@ -262,6 +262,12 @@ void object::post_load_check () { + if (type >= NUM_TYPES) + { + LOG (llevError, "%s: type out of range, resetting to 0.\n", debug_desc ()); + type = 0; + } + switch (type) { case BOW: @@ -380,8 +386,10 @@ * similarly, it item_power is 0, the first check will always pass, * but not the second one. */ +#if 0 //TODO if (ip > 2 * item_power && ip > (item_power + 3)) LOG (llevDebug, "Object %s seems to have too low item power? %d > %d\n", debug_desc (), ip, item_power); +#endif } /* Old spellcasting object - need to load in the appropiate object */ @@ -511,11 +519,7 @@ } } -#define GET_FLAG(op,flag) \ - if (f.get_sint32 ()) \ - SET_FLAG (op, flag); \ - else \ - CLEAR_FLAG (op, flag) \ +#define GET_FLAG(op,flg) op->flag [flg] = f.get_bool () bool object::parse_kv (object_thawer &f) @@ -771,7 +775,7 @@ break; case KW_friendly: - if (f.get_sint32 ()) + if (f.get_bool ()) if (type != PLAYER) add_friendly_object (this);