--- deliantra/server/common/loader.C 2007/08/25 22:19:26 1.99
+++ deliantra/server/common/loader.C 2007/11/08 19:43:23 1.105
@@ -1,11 +1,11 @@
/*
- * This file is part of Crossfire TRT, the Roguelike Realtime MORPG.
+ * This file is part of Deliantra, the Roguelike Realtime MMORPG.
*
- * Copyright (©) 2005,2006,2007 Marc Alexander Lehmann / Robin Redeker / the Crossfire TRT team
+ * Copyright (©) 2005,2006,2007 Marc Alexander Lehmann / Robin Redeker / the Deliantra team
* Copyright (©) 2002,2007 Mark Wedel & Crossfire Development Team
* Copyright (©) 1992,2007 Frank Tore Johansen
*
- * Crossfire TRT is free software: you can redistribute it and/or modify
+ * Deliantra 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 3 of the License, or
* (at your option) any later version.
@@ -18,7 +18,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*
- * The authors can be reached via e-mail to
+ * The authors can be reached via e-mail to
*/
/* Eneq(@csd.uu.se): Added weight-modifiers in environment of objects.
@@ -31,6 +31,8 @@
/////////////////////////////////////////////////////////////////////////////
+extern archetype *loading_arch;
+
/* This table is only necessary to convert objects that existed before the
* spell object conversion to the new object. It was not practical
* to go through every mapping looking for every potion, rod, wand, etc
@@ -169,7 +171,7 @@
"spell_disarm", /* 124 */
"spell_cure_confusion", /* 125 */
"spell_restoration", /* 126 */
- "was summon evil monster", /* 127 *//* Not implenented as nothing used it */
+ "spell_summon_devil", /* 127 *//* Not implenented as nothing used it */
"spell_counterwall", /* 128 */
"spell_cause_light_wounds", /* 129 */
"spell_cause_medium_wounds", /* 130 */
@@ -251,8 +253,6 @@
NULL
};
-extern bool loading_arch;
-
/* This function checks the object after it has been loaded (when we
* get the 'end' in the input stream). This function can be used to
* deal with legacy objects where fields may have changed. It can also be used
@@ -396,7 +396,7 @@
/* POTIONS and ALTARS don't always cast spells, but if they do, update them */
((type == POTION || type == ALTAR) && stats.sp)) && !inv && !loading_arch)
{
- /* Fireall is bizarre in that spell type was stored in dam. Rest are 'normal'
+ /* Firewall is bizarre in that spell type was stored in dam. Rest are 'normal'
* in that spell was stored in sp.
*/
object *tmp = get_archetype (spell_mapping[type == FIREWALL ? stats.dam : stats.sp]);
@@ -558,6 +558,7 @@
case KW_skill: f.get_ornull (skill); break;
case KW_race: f.get_ornull (race); break;
case KW_slaying: f.get_ornull (slaying); break;
+ case KW_tag: f.get_ornull (tag); break;
case KW_arch:
{
@@ -569,6 +570,7 @@
// but manually adding it can improve map loading times a lot
// also, appending instead of prepending keeps the
// save ordering the same between repeated load/saves.
+ // and finally we do not want any funny effects
CLEAR_FLAG (tmp, FLAG_OBJ_ORIGINAL);
CLEAR_FLAG (tmp, FLAG_REMOVED);
@@ -604,21 +606,7 @@
break;
case KW_owner:
- if (const char *s = f.get_str ())
- {
- unsigned int version;
- unsigned long long seq;
- char name[256];
-
- if (3 == sscanf (s, "<%d.%llx>/%256s", &version, &seq, name) && version == 1)
- {
- UUID uuid = seq;
- player *pl = player::find (name);
-
- if (pl && pl->ob->uuid == uuid)
- owner = pl->ob;
- }
- }
+ f.delayed_deref (this, owner, f.get_str ());
break;
case KW_animation:
@@ -1067,7 +1055,6 @@
{
object_thawer f (buf, (AV *)0);
- f.next ();
return op->parse_kv (f);
}
@@ -1292,13 +1279,8 @@
#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)
- if (object *pl = op->owner)
- if (pl->contr)
- {
- char owner[256];
- snprintf (owner, sizeof (owner), "<1.%llx>/%s", (unsigned long long)pl->uuid.seq, &pl->name);
- f.put (KW_owner, (const char *)owner);
- }
+ if (object *owner = op->owner)
+ f.put (KW_owner, static_cast(owner->ref ()));
CMP_OUT (name);
CMP_OUT (name_pl);
@@ -1306,6 +1288,7 @@
CMP_OUT (title);
CMP_OUT (race);
CMP_OUT (slaying);
+ CMP_OUT (tag);
CMP_OUT (other_arch);
if (op->msg != tmp->msg ) f.put (KW_msg , KW_endmsg , op->msg );
@@ -1459,8 +1442,6 @@
bool success = false;
bool seen_arch = false;
- f.next ();
-
for (;;)
{
switch (f.kw)