--- deliantra/server/common/loader.C 2009/01/08 03:03:23 1.127 +++ deliantra/server/common/loader.C 2009/09/17 01:57:31 1.132 @@ -1,7 +1,7 @@ /* * This file is part of Deliantra, the Roguelike Realtime MMORPG. * - * Copyright (©) 2005,2006,2007,2008 Marc Alexander Lehmann / Robin Redeker / the Deliantra team + * Copyright (©) 2005,2006,2007,2008,2009 Marc Alexander Lehmann / Robin Redeker / the Deliantra team * Copyright (©) 2002,2007 Mark Wedel & Crossfire Development Team * Copyright (©) 1992,2007 Frank Tore Johansen * @@ -463,6 +463,19 @@ move_type = MOVE_WALK; } } + + // if the object has an animation, try to provide a default face + if (has_anim ()) + { + const animation &anim_ob = anim (); + + if (anim_speed) + // if this item is time-animated, force the last frame + animate_object (this, 0); + else if (flag [FLAG_MONSTER]) + // if it is a monster, set appropriate facing + animate_object (this, direction); + } } static void @@ -929,7 +942,7 @@ case KW_will_apply: f.get (will_apply); break; case KW_attack_movement: f.get (attack_movement); break; case KW_move_state: f.get (move_status); break; - case KW_expmul: f.get (expmul); break; + //case KW_expmul: f.get (expmul); break;//D declared const for the time being case KW_glow_radius: f.get (glow_radius); break; case KW_weapontype: f.get (weapontype); break; case KW_casting_time: f.get (casting_time); break; @@ -1317,8 +1330,8 @@ if (op->sound_destroy != tmp->sound_destroy) f.put (KW_sound_destroy, op->sound_destroy ? &faces [op->sound_destroy] : 0); if (op->animation_id != tmp->animation_id) - if (op->animation_id) - f.put (KW_animation, animations[GET_ANIM_ID (op)].name); + if (op->has_anim ()) + f.put (KW_animation, op->anim ().name); else { f.put (KW_animation, (const char *)0); @@ -1432,10 +1445,16 @@ bool object::write (object_freezer &f) { - archetype *at = arch ? arch : archetype::empty; - - f.put (KW_arch, at->archname); - write_diff (f, this, at); + if (is_arch ()) + { + f.put (KW_object, arch->archname); + write_diff (f, this, archetype::empty); + } + else + { + f.put (KW_arch, arch->archname); + write_diff (f, this, arch); + } for (object *tmp = inv; tmp; tmp = tmp->below) tmp->write (f);