… | |
… | |
403 | * of archetype-structures. |
403 | * of archetype-structures. |
404 | */ |
404 | */ |
405 | void |
405 | void |
406 | first_arch_pass (object_thawer & fp) |
406 | first_arch_pass (object_thawer & fp) |
407 | { |
407 | { |
408 | archetype *at, *head = NULL, *last_more = NULL; |
408 | archetype *head = 0, *last_more = 0; |
409 | |
409 | |
|
|
410 | archetype *at = new archetype; |
410 | at->clone.arch = first_archetype = at = new archetype; |
411 | at->clone.arch = first_archetype = at; |
411 | |
412 | |
412 | while (int i = load_object (fp, &at->clone, 0)) |
413 | while (int i = load_object (fp, &at->clone, 0)) |
413 | { |
414 | { |
414 | at->clone.speed_left = (float) (-0.1); |
415 | at->clone.speed_left = (float) (-0.1); |
415 | /* copy the body_info to the body_used - this is only really |
416 | /* copy the body_info to the body_used - this is only really |
… | |
… | |
810 | object *op = get_object (); |
811 | object *op = get_object (); |
811 | |
812 | |
812 | if ((at = type_to_archetype (type)) == NULL) |
813 | if ((at = type_to_archetype (type)) == NULL) |
813 | { |
814 | { |
814 | LOG (llevError, "Can't clone archetype %d\n", type); |
815 | LOG (llevError, "Can't clone archetype %d\n", type); |
815 | free_object (op); |
816 | op->destroy (0); |
816 | return NULL; |
817 | return NULL; |
817 | } |
818 | } |
818 | |
819 | |
819 | copy_object (&at->clone, op); |
820 | copy_object (&at->clone, op); |
820 | op->instantiate (); |
821 | op->instantiate (); |