--- deliantra/server/common/loader.C 2006/09/21 00:05:24 1.19 +++ deliantra/server/common/loader.C 2006/12/18 03:00:02 1.25 @@ -28,7 +28,6 @@ #include #include -#include #include /* Maps the MOVE_* values to names */ @@ -282,7 +281,7 @@ op->name_pl = op->name; /* objects now have a materialname. try to patch it in */ - if (!(IS_WEAPON (op) && op->level > 0)) + if (!(op->is_weapon () && op->level > 0)) { if (op->map != NULL) set_materialname (op, op->map->difficulty, NULL); @@ -558,7 +557,7 @@ tmp = arch_to_object (arch); else { - tmp = get_object (); + tmp = object::create (); /* record the name of the broken object */ tmp->name = str; } @@ -595,7 +594,7 @@ else { LOG (llevDebug, "Discarding object without arch: %s\n", tmp->name ? (const char *) tmp->name : "(null)"); - free_object (tmp); + tmp->destroy (); } } else @@ -603,8 +602,8 @@ /* This is the actual archetype definition then */ op->arch = archetype::find (str); - if (op->arch != NULL) - copy_object (&op->arch->clone, op); + if (op->arch) + op->arch->clone.copy_to (op); else if (!arch_init) /* record the name of the broken object */ op->name = str; @@ -1083,19 +1082,9 @@ int set_variable (object *op, char *buf) { - return 0; -#if 0 - int retval; - object_thawer thawer (0); + object_thawer thawer (buf, (AV *)0); - strcpy (msgbuf, ""); - strcpy (lorebuf, ""); - retval = parse_object (op, thawer, 0); - yy_switch_to_buffer (yycurbuf); - yy_delete_buffer (yybufstate); - yy_pop_state (); - return retval; -#endif + return parse_object (op, thawer, 0); } /* @@ -1315,7 +1304,7 @@ } /* We don't need to worry about the arch's extra fields - they - * will get taken care of the copy_object function. + * will get taken care of the copy_to method. */ { @@ -1442,7 +1431,7 @@ CMP_OUT (move_slow); CMP_OUT (move_slow_penalty); - if (!COMPARE_FLAGS (op, tmp)) + if (op->flags != tmp->flags) for (i = 0; i <= NUM_FLAGS; i++) if (flag_names[i] && (QUERY_FLAG (op, i) != QUERY_FLAG (tmp, i))) f.put (flag_names[i], QUERY_FLAG (op, i) ? "1" : "0"); @@ -1510,10 +1499,7 @@ } if (!(flag & 2)) - { - remove_ob (op); - free_object (op); - } + op->destroy (); fp.put (op); fprintf (fp, "end\n");