--- deliantra/server/common/loader.C 2007/05/26 15:44:02 1.85 +++ deliantra/server/common/loader.C 2007/08/01 01:53:13 1.96 @@ -1,25 +1,24 @@ /* - * 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 authors can be reached via e-mail at + * along with this program. If not, see . + * + * The authors can be reached via e-mail to */ /* Eneq(@csd.uu.se): Added weight-modifiers in environment of objects. @@ -327,7 +326,7 @@ * Otherwise, what happens is that the the plural name will lose * information (appear as just 'hearts' and not 'goblins heart') */ - if (arch && name != arch->clone.name && name_pl == arch->clone.name_pl) + if (arch && name != arch->object::name && name_pl == arch->object::name_pl) name_pl = 0; if (!name_pl) @@ -412,7 +411,7 @@ insert_ob_in_ob (tmp, this); randomitems = NULL; /* So another spell isn't created for this object */ /* without this, value is all screwed up */ - value = arch->clone.value * inv->value; + value = arch->value * inv->value; } if (QUERY_FLAG (this, FLAG_MONSTER)) @@ -640,6 +639,14 @@ face = face_find (f.get_str ()); break; + case KW_sound: + sound = sound_find (f.get_str ()); + break; + + case KW_sound_die: + sound_die = sound_find (f.get_str ()); + break; + case KW_x: f.get (x); break; case KW_y: f.get (y); break; @@ -961,23 +968,10 @@ case KW_msg: f.get_ml (KW_endmsg, msg); - //TODO: allow longer messages - if (strlen (msg) >= HUGE_BUF) - { - LOG (llevDebug, "\tError message length >= %d: %d\n>%.80s<\n", HUGE_BUF, strlen (msg), &msg); - msg = "ERROR, please report: string too long, winged.\n"; - } break; case KW_lore: f.get_ml (KW_endlore, lore); - //TODO: allow longer messages - /* Just print a warning so we can be reasonably safe - * about not overflowing the buffer. - */ - if (strlen (lore) > (HUGE_BUF / 2)) - LOG (llevDebug, "\tWarning lore length > %d (max allowed=%d): %d\n>%.80s<\n", - HUGE_BUF / 2, HUGE_BUF, strlen (lore), &lore); break; case KW_editable: @@ -1026,7 +1020,7 @@ object *op = object::create (); op->map = map; - arch->clone.copy_to (op); + arch->copy_to (op); // copy_to activates, this should be fixed properly op->deactivate (); @@ -1282,15 +1276,14 @@ CMP_OUT (title); CMP_OUT (race); CMP_OUT (slaying); - - if (op->msg != tmp->msg) - f.put (KW_msg, KW_endmsg, op->msg); - if (op->lore != tmp->lore) - f.put (KW_lore, KW_endlore, op->lore); - CMP_OUT (other_arch); - if (op->face != tmp->face) f.put (KW_face, op->face ? &faces [op->face] : 0); + if (op->msg != tmp->msg ) f.put (KW_msg , KW_endmsg , op->msg ); + if (op->lore != tmp->lore) f.put (KW_lore, KW_endlore, op->lore); + + if (op->face != tmp->face ) f.put (KW_face , op->face ? &faces [op->face ] : 0); + if (op->sound != tmp->sound ) f.put (KW_sound , op->sound ? &faces [op->sound ] : 0); + if (op->sound_die != tmp->sound_die) f.put (KW_sound_die, op->sound_die ? &faces [op->sound_die] : 0); if (op->animation_id != tmp->animation_id) if (op->animation_id) @@ -1298,10 +1291,10 @@ f.put (KW_animation, animations[GET_ANIM_ID (op)].name); if (!QUERY_FLAG (op, FLAG_ANIMATE)) - f.put (KW_is_animated, (sint32) 0); + f.put (KW_is_animated, (sint32)0); } else - f.put (KW_animation, (const char *) 0); + f.put (KW_animation, (const char *)0); CMP_OUT2 (str, stats.Str); CMP_OUT2 (dex, stats.Dex); @@ -1419,8 +1412,8 @@ archetype *at = arch ? (archetype *)arch : empty_archetype; - f.put (KW_arch, at->name); - write_diff (f, this, &at->clone); + f.put (KW_arch, at->archname); + write_diff (f, this, at); for (object *tmp = inv; tmp; tmp = tmp->below) tmp->write (f);