--- deliantra/server/common/loader.C 2009/06/27 08:35:03 1.129 +++ deliantra/server/common/loader.C 2009/09/23 04:07:52 1.133 @@ -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 @@ -1291,7 +1304,8 @@ * will get taken care of the copy_to method. */ - f.put (KW_uuid, op->uuid.c_str ()); + if (op->uuid) + f.put (KW_uuid, op->uuid.c_str ()); #define CMP_OUT(v) if (expect_false (op->v != tmp->v)) f.put (KW_ ## v, op->v) #define CMP_OUT2(k,v) if (expect_false (op->v != tmp->v)) f.put (KW_ ## k, op->v) @@ -1432,10 +1446,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);