--- deliantra/server/common/loader.C 2009/11/16 22:31:13 1.149 +++ deliantra/server/common/loader.C 2010/01/16 13:41:37 1.151 @@ -1,7 +1,7 @@ /* * This file is part of Deliantra, the Roguelike Realtime MMORPG. * - * Copyright (©) 2005,2006,2007,2008,2009 Marc Alexander Lehmann / Robin Redeker / the Deliantra team + * Copyright (©) 2005,2006,2007,2008,2009,2010 Marc Alexander Lehmann / Robin Redeker / the Deliantra team * Copyright (©) 2002,2007 Mark Wedel & Crossfire Development Team * Copyright (©) 1992,2007 Frank Tore Johansen * @@ -23,7 +23,6 @@ */ #include -#include #include ///////////////////////////////////////////////////////////////////////////// @@ -335,6 +334,13 @@ if (material == MATERIAL_NULL && !(is_weapon () && level > 0)) select_material (this, map ? map->difficulty : 5); + if (speed < 0.) + { + flag [FLAG_RANDOM_SPEED] = true; + speed = -speed; + // speed_left will be randomised in instantiate () and copy_to () + } + /* only do these when program is first run - a bit * excessive to do this at every run - most of this is * really just to catch any errors - program will still run, but @@ -640,6 +646,7 @@ case KW_last_sp: f.get (last_sp); break; case KW_last_grace: f.get (last_grace); break; case KW_last_eat: f.get (last_eat); break; + case KW_sl: case KW_speed_left: f.get (speed_left); break; case KW_speed: @@ -918,6 +925,7 @@ case KW_destroy_on_death: GET_FLAG (this, FLAG_DESTROY_ON_DEATH); break; case KW_treasure_env: GET_FLAG (this, FLAG_TREASURE_ENV); break; case KW_precious: GET_FLAG (this, FLAG_PRECIOUS); break; + case KW_random_speed: GET_FLAG (this, FLAG_RANDOM_SPEED); break; case KW_armour: f.get (resist[ATNR_PHYSICAL]); break; case KW_resist_physical: f.get (resist[ATNR_PHYSICAL]); break; @@ -1248,7 +1256,7 @@ KW_no_attack, KW_no_damage, KW_obj_original, - KW_NULL, + KW_random_speed, KW_activate_on_push, KW_activate_on_release, KW_is_water, @@ -1305,7 +1313,6 @@ CMP_OUT (name); CMP_OUT (name_pl); - CMP_OUT (speed); // speed_left is a major time-burner, and has good locality, so @@ -1313,14 +1320,14 @@ if (op->speed_left != arch->speed_left) { static double last_speed_left = 0.; - static char last_speed_left_str [256] = "speed_left 0\n"; - static int last_speed_left_len = sizeof ("speed_left 0\n") - 1; + static char last_speed_left_str [256] = "sl 0\n"; + static int last_speed_left_len = sizeof ("sl 0\n") - 1; if (last_speed_left != op->speed_left) { last_speed_left = op->speed_left; - last_speed_left_len = sizeof ("speed_left ") - 1 - + sprintf (last_speed_left_str + sizeof ("speed_left ") - 1, "%.7g\n", last_speed_left); + last_speed_left_len = sizeof ("sl ") - 1 + + sprintf (last_speed_left_str + sizeof ("sl ") - 1, "%.7g\n", last_speed_left); } f.add (last_speed_left_str, last_speed_left_len); @@ -1418,6 +1425,7 @@ f.put (KW(connected), ol->id); CMP_OUT (randomitems); + CMP_OUT2 (container, weight_limit); CMP_OUT (run_away);