--- deliantra/server/common/loader.C 2006/09/11 20:28:37 1.13 +++ deliantra/server/common/loader.C 2006/09/12 19:20:06 1.14 @@ -257,35 +257,6 @@ extern int arch_init; -// return a suitable strign describign an objetc in enough detail to find it -// used only in check_loaded_object: TODO remove static, move it elsewhere and -// use it in more log messages. -static char * -op_debug_info_ (object *op, char *info) -{ - char info2[256 * 3]; - char *p = info; - - p += snprintf (p, 256, "%d=\"%s%s%s\"", - op->count, op->name ? (const char *) op->name : "(anon)", op->title ? " " : "", op->title ? (const char *) op->title : ""); - - if (op->env) - p += snprintf (p, 256, "(in %s)", op_debug_info_ (op->env, info2)); - - if (op->map) - p += snprintf (p, 256, "(on %s@%d+%d)", op->map->path, op->x, op->y); - - return info; -} - -static char * -op_debug_info (object *op) -{ - static char info[256 * 3]; - - return op_debug_info_ (op, info); -} - /* 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 @@ -328,12 +299,12 @@ { if (!op->skill) { - LOG (llevError, "Weapon %s lacks a skill.\n", op_debug_info (op)); + LOG (llevError, "Weapon %s lacks a skill.\n", op->debug_desc ()); } else if ((!strcmp (op->skill, "one handed weapons") && op->body_info[1] != -1) || (!strcmp (op->skill, "two handed weapons") && op->body_info[1] != -2)) { - LOG (llevError, "weapon %s arm usage does not match skill: %d, %s\n", op_debug_info (op), op->body_info[1], &op->skill); + LOG (llevError, "weapon %s arm usage does not match skill: %d, %s\n", op->debug_desc (), op->body_info[1], &op->skill); } } @@ -349,7 +320,7 @@ { if (op->last_heal) { - LOG (llevDebug, "Object %s still has last_heal set, not gen_sp_armour\n", op_debug_info (op)); + LOG (llevDebug, "Object %s still has last_heal set, not gen_sp_armour\n", op->debug_desc ()); op->gen_sp_armour = op->last_heal; op->last_heal = 0; } @@ -362,7 +333,7 @@ { if (ip > 3) { - LOG (llevDebug, "Object %s had no item power, using %d\n", op_debug_info (op), ip); + LOG (llevDebug, "Object %s had no item power, using %d\n", op->debug_desc (), ip); } op->item_power = ip; } @@ -374,7 +345,7 @@ */ if (ip > 2 * op->item_power && ip > (op->item_power + 3)) { - LOG (llevDebug, "Object %s seems to have too low item power? %d > %d\n", op_debug_info (op), ip, op->item_power); + LOG (llevDebug, "Object %s seems to have too low item power? %d > %d\n", op->debug_desc (), ip, op->item_power); } } @@ -408,12 +379,13 @@ if (QUERY_FLAG (op, FLAG_MONSTER)) { if (op->stats.hp > op->stats.maxhp) - LOG (llevDebug, "Monster %s has hp set higher than maxhp (%d>%d)\n", op_debug_info (op), op->stats.hp, op->stats.maxhp); + LOG (llevDebug, "Monster %s has hp set higher than maxhp (%d>%d)\n", op->debug_desc (), op->stats.hp, op->stats.maxhp); /* The archs just need to be updated for this */ if (op->move_type == 0) op->move_type = MOVE_WALK; } + if ((QUERY_FLAG (op, FLAG_GENERATOR) && QUERY_FLAG (op, FLAG_CONTENT_ON_GEN)) || op->type == CREATOR || op->type == CONVERTER) { /* Object will duplicate it's content as part of the