--- deliantra/server/common/loader.C 2006/12/12 20:53:02 1.21 +++ deliantra/server/common/loader.C 2006/12/25 11:25:49 1.28 @@ -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); @@ -490,7 +489,7 @@ CLEAR_FLAG (op, flag) \ int -parse_object (object *op, object_thawer & thawer, int map_flags) +parse_object (object *op, object_thawer &thawer, int map_flags) { bool ismore = 0; object *op_inv = op->inv; @@ -505,7 +504,7 @@ case KW_object: thawer.get (op->name); - if (op->arch != NULL) + if (op->arch) op->arch->name = op->name; break; @@ -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)"); - tmp->destroy (0); + 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; @@ -828,7 +827,6 @@ case KW_use_content_on_gen: GET_FLAG (op, FLAG_CONTENT_ON_GEN); break; case KW_is_thrown: GET_FLAG (op, FLAG_IS_THROWN); break; case KW_auto_apply: GET_FLAG (op, FLAG_AUTO_APPLY); break; - case KW_treasure: GET_FLAG (op, FLAG_TREASURE); break; case KW_see_invisible: GET_FLAG (op, FLAG_SEE_INVISIBLE); break; case KW_can_roll: GET_FLAG (op, FLAG_CAN_ROLL); break; case KW_overlay_floor: GET_FLAG (op, FLAG_OVERLAY_FLOOR); break; @@ -1066,14 +1064,12 @@ * LO_NOREAD (3): Reset the buffers, but don't read from it. (op can be null) * */ - int -load_object (object_thawer & fp, object *op, int map_flags) +load_object (object_thawer &fp, object *op, int map_flags) { return parse_object (op, fp, map_flags); } - /* This takes a buffer, scans it for variables, and sets those variables * as appropriate in op. * @@ -1185,7 +1181,7 @@ KW_generator, KW_is_thrown, KW_auto_apply, - KW_treasure, + KW_NULL, // was KW_treasure KW_player_sold, /* 20 */ KW_see_invisible, @@ -1305,7 +1301,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. */ { @@ -1432,10 +1428,10 @@ CMP_OUT (move_slow); CMP_OUT (move_slow_penalty); - if (!COMPARE_FLAGS (op, tmp)) + if (op->flag != tmp->flag) 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"); + if (flag_names [i] && op->flag [i] != tmp->flag [i]) + f.put (flag_names [i], op->flag [i] ? "1" : "0"); /* Save body locations */ for (i = 0; i < NUM_BODY_LOCATIONS; i++) @@ -1500,10 +1496,7 @@ } if (!(flag & 2)) - { - op->remove (); - op->destroy (0); - } + op->destroy (); fp.put (op); fprintf (fp, "end\n");