… | |
… | |
698 | if (!uuid.seq) // HACK |
698 | if (!uuid.seq) // HACK |
699 | uuid = UUID::gen (); |
699 | uuid = UUID::gen (); |
700 | |
700 | |
701 | // TODO: unclean state changes, should nt be done in copy_to AND instantiate |
701 | // TODO: unclean state changes, should nt be done in copy_to AND instantiate |
702 | if (flag [FLAG_RANDOM_SPEED] && speed) |
702 | if (flag [FLAG_RANDOM_SPEED] && speed) |
703 | speed_left = -rndm (); // TODO animation |
703 | speed_left = - speed - rndm (); // TODO animation |
704 | else |
704 | else |
705 | speed_left = -speed; |
705 | speed_left = -1.; |
706 | |
706 | |
707 | /* copy the body_info to the body_used - this is only really |
707 | /* copy the body_info to the body_used - this is only really |
708 | * need for monsters, but doesn't hurt to do it for everything. |
708 | * need for monsters, but doesn't hurt to do it for everything. |
709 | * by doing so, when a monster is created, it has good starting |
709 | * by doing so, when a monster is created, it has good starting |
710 | * values for the body_used info, so when items are created |
710 | * values for the body_used info, so when items are created |
… | |
… | |
722 | object *neu = create (); |
722 | object *neu = create (); |
723 | copy_to (neu); |
723 | copy_to (neu); |
724 | |
724 | |
725 | // TODO: unclean state changes, should not be done in clone AND instantiate |
725 | // TODO: unclean state changes, should not be done in clone AND instantiate |
726 | if (neu->flag [FLAG_RANDOM_SPEED] && neu->speed) |
726 | if (neu->flag [FLAG_RANDOM_SPEED] && neu->speed) |
727 | neu->speed_left = -rndm (); // TODO animation |
727 | neu->speed_left = - neu->speed - rndm (); // TODO animation |
728 | |
728 | |
729 | neu->map = map; // not copied by copy_to |
729 | neu->map = map; // not copied by copy_to |
730 | return neu; |
730 | return neu; |
731 | } |
731 | } |
732 | |
732 | |
… | |
… | |
1554 | |
1554 | |
1555 | for (object *tmp = op->ms ().bot; tmp; tmp = tmp->above) |
1555 | for (object *tmp = op->ms ().bot; tmp; tmp = tmp->above) |
1556 | if (tmp->arch->archname == archname) /* same archetype */ |
1556 | if (tmp->arch->archname == archname) /* same archetype */ |
1557 | tmp->destroy (); |
1557 | tmp->destroy (); |
1558 | |
1558 | |
1559 | object *tmp = arch_to_object (archetype::find (archname)); |
1559 | object *tmp = archetype::find (archname)->instance (); |
1560 | |
1560 | |
1561 | tmp->x = op->x; |
1561 | tmp->x = op->x; |
1562 | tmp->y = op->y; |
1562 | tmp->y = op->y; |
1563 | |
1563 | |
1564 | insert_ob_in_map (tmp, op->map, op, 0); |
1564 | insert_ob_in_map (tmp, op->map, op, 0); |