ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/common/object.C
(Generate patch)

Comparing deliantra/server/common/object.C (file contents):
Revision 1.305 by root, Wed Nov 11 04:45:22 2009 UTC vs.
Revision 1.306 by root, Sun Nov 29 09:41:27 2009 UTC

687 tail = new_link; 687 tail = new_link;
688 } 688 }
689 } 689 }
690 } 690 }
691 691
692 if (speed < 0)
693 dst->speed_left -= rndm ();
694
695 dst->activate (); 692 dst->activate ();
696} 693}
697 694
698void 695void
699object::instantiate () 696object::instantiate ()
700{ 697{
701 if (!uuid.seq) // HACK 698 if (!uuid.seq) // HACK
702 uuid = UUID::gen (); 699 uuid = UUID::gen ();
703 700
701 // TODO: unclean state changes, should nt be done in copy_to AND instantiate
702 if (flag [FLAG_RANDOM_SPEED] && speed)
703 speed_left = -rndm (); // TODO animation
704 else
704 speed_left = -0.1f; 705 speed_left = -speed;
706
705 /* 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
706 * 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.
707 * 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
708 * values for the body_used info, so when items are created 710 * values for the body_used info, so when items are created
709 * for it, they can be properly equipped. 711 * for it, they can be properly equipped.
717object * 719object *
718object::clone () 720object::clone ()
719{ 721{
720 object *neu = create (); 722 object *neu = create ();
721 copy_to (neu); 723 copy_to (neu);
724
725 // TODO: unclean state changes, should not be done in clone AND instantiate
726 if (neu->flag [FLAG_RANDOM_SPEED] && neu->speed)
727 neu->speed_left = -rndm (); // TODO animation
728
722 neu->map = map; // not copied by copy_to 729 neu->map = map; // not copied by copy_to
723 return neu; 730 return neu;
724} 731}
725 732
726/* 733/*

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines