… | |
… | |
556 | |
556 | |
557 | if (arch != NULL) |
557 | if (arch != NULL) |
558 | tmp = arch_to_object (arch); |
558 | tmp = arch_to_object (arch); |
559 | else |
559 | else |
560 | { |
560 | { |
561 | tmp = get_object (); |
561 | tmp = object::create (); |
562 | /* record the name of the broken object */ |
562 | /* record the name of the broken object */ |
563 | tmp->name = str; |
563 | tmp->name = str; |
564 | } |
564 | } |
565 | |
565 | |
566 | parse_object (tmp, thawer, map_flags); |
566 | parse_object (tmp, thawer, map_flags); |
… | |
… | |
593 | op_inv = tmp; |
593 | op_inv = tmp; |
594 | } |
594 | } |
595 | else |
595 | else |
596 | { |
596 | { |
597 | LOG (llevDebug, "Discarding object without arch: %s\n", tmp->name ? (const char *) tmp->name : "(null)"); |
597 | LOG (llevDebug, "Discarding object without arch: %s\n", tmp->name ? (const char *) tmp->name : "(null)"); |
598 | free_object (tmp); |
598 | tmp->destroy (); |
599 | } |
599 | } |
600 | } |
600 | } |
601 | else |
601 | else |
602 | { |
602 | { |
603 | /* This is the actual archetype definition then */ |
603 | /* This is the actual archetype definition then */ |
604 | op->arch = archetype::find (str); |
604 | op->arch = archetype::find (str); |
605 | |
605 | |
606 | if (op->arch != NULL) |
606 | if (op->arch) |
607 | copy_object (&op->arch->clone, op); |
607 | op->arch->clone.copy_to (op); |
608 | else if (!arch_init) |
608 | else if (!arch_init) |
609 | /* record the name of the broken object */ |
609 | /* record the name of the broken object */ |
610 | op->name = str; |
610 | op->name = str; |
611 | } |
611 | } |
612 | } |
612 | } |
… | |
… | |
1081 | * override values and in c_wiz to mutate values. |
1081 | * override values and in c_wiz to mutate values. |
1082 | */ |
1082 | */ |
1083 | int |
1083 | int |
1084 | set_variable (object *op, char *buf) |
1084 | set_variable (object *op, char *buf) |
1085 | { |
1085 | { |
1086 | return 0; |
|
|
1087 | #if 0 |
|
|
1088 | int retval; |
|
|
1089 | object_thawer thawer (0); |
1086 | object_thawer thawer (buf, (AV *)0); |
1090 | |
1087 | |
1091 | strcpy (msgbuf, ""); |
|
|
1092 | strcpy (lorebuf, ""); |
|
|
1093 | retval = parse_object (op, thawer, 0); |
1088 | return parse_object (op, thawer, 0); |
1094 | yy_switch_to_buffer (yycurbuf); |
|
|
1095 | yy_delete_buffer (yybufstate); |
|
|
1096 | yy_pop_state (); |
|
|
1097 | return retval; |
|
|
1098 | #endif |
|
|
1099 | } |
1089 | } |
1100 | |
1090 | |
1101 | /* |
1091 | /* |
1102 | * Initialises the array of variable-names. Needed before any |
1092 | * Initialises the array of variable-names. Needed before any |
1103 | * objects can be loaded. Called by init_library(). |
1093 | * objects can be loaded. Called by init_library(). |
… | |
… | |
1313 | if (!arch_field || my_field->value != arch_field->value) |
1303 | if (!arch_field || my_field->value != arch_field->value) |
1314 | f.put (my_field->key, my_field->value); |
1304 | f.put (my_field->key, my_field->value); |
1315 | } |
1305 | } |
1316 | |
1306 | |
1317 | /* We don't need to worry about the arch's extra fields - they |
1307 | /* We don't need to worry about the arch's extra fields - they |
1318 | * will get taken care of the copy_object function. |
1308 | * will get taken care of the copy_to method. |
1319 | */ |
1309 | */ |
1320 | |
1310 | |
1321 | { |
1311 | { |
1322 | char uids[64]; |
1312 | char uids[64]; |
1323 | snprintf (uids, sizeof (uids), "<1.%llx>", (unsigned long long)op->uuid.seq); |
1313 | snprintf (uids, sizeof (uids), "<1.%llx>", (unsigned long long)op->uuid.seq); |
… | |
… | |
1508 | save_object (fp, tmp, flag); |
1498 | save_object (fp, tmp, flag); |
1509 | old = tmp; |
1499 | old = tmp; |
1510 | } |
1500 | } |
1511 | |
1501 | |
1512 | if (!(flag & 2)) |
1502 | if (!(flag & 2)) |
1513 | { |
1503 | op->destroy (); |
1514 | remove_ob (op); |
|
|
1515 | free_object (op); |
|
|
1516 | } |
|
|
1517 | |
1504 | |
1518 | fp.put (op); |
1505 | fp.put (op); |
1519 | fprintf (fp, "end\n"); |
1506 | fprintf (fp, "end\n"); |
1520 | } |
1507 | } |
1521 | |
1508 | |