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.119 by root, Fri Jan 19 18:06:51 2007 UTC vs.
Revision 1.123 by root, Fri Jan 26 20:59:56 2007 UTC

670 face = blank_face; 670 face = blank_face;
671} 671}
672 672
673object::~object () 673object::~object ()
674{ 674{
675 if (index)
676 unlink (); 675 unlink ();
677 676
678 free_key_values (this); 677 free_key_values (this);
679} 678}
680 679
681static int object_count; 680static int object_count;
690 objects.insert (this); 689 objects.insert (this);
691} 690}
692 691
693void object::unlink () 692void object::unlink ()
694{ 693{
695 assert (index);//D 694 if (!index)
695 return;
696
696 objects.erase (this); 697 objects.erase (this);
697 refcnt_dec (); 698 refcnt_dec ();
698} 699}
699 700
700void 701void
774 * drop on that space. 775 * drop on that space.
775 */ 776 */
776 if (!drop_to_ground 777 if (!drop_to_ground
777 || !map 778 || !map
778 || map->in_memory != MAP_IN_MEMORY 779 || map->in_memory != MAP_IN_MEMORY
780 || map->nodrop
779 || ms ().move_block == MOVE_ALL) 781 || ms ().move_block == MOVE_ALL)
780 { 782 {
781 while (inv) 783 while (inv)
782 { 784 {
783 inv->destroy_inv (drop_to_ground); 785 inv->destroy_inv (drop_to_ground);
899 * This function removes the object op from the linked list of objects 901 * This function removes the object op from the linked list of objects
900 * which it is currently tied to. When this function is done, the 902 * which it is currently tied to. When this function is done, the
901 * object will have no environment. If the object previously had an 903 * object will have no environment. If the object previously had an
902 * environment, the x and y coordinates will be updated to 904 * environment, the x and y coordinates will be updated to
903 * the previous environment. 905 * the previous environment.
904 * Beware: This function is called from the editor as well!
905 */ 906 */
906void 907void
907object::remove_slow () 908object::remove_slow ()
908{ 909{
909 object *tmp, *last = 0; 910 object *tmp, *last = 0;
1749 if ((!op->move_type && tmp->move_slow & MOVE_WALK) || 1750 if ((!op->move_type && tmp->move_slow & MOVE_WALK) ||
1750 ((op->move_type & tmp->move_slow) && (op->move_type & ~tmp->move_slow & ~tmp->move_block) == 0)) 1751 ((op->move_type & tmp->move_slow) && (op->move_type & ~tmp->move_slow & ~tmp->move_block) == 0))
1751 { 1752 {
1752 1753
1753 float 1754 float
1754 diff = tmp->move_slow_penalty * FABS (op->speed); 1755 diff = tmp->move_slow_penalty * fabs (op->speed);
1755 1756
1756 if (op->type == PLAYER) 1757 if (op->type == PLAYER)
1757 if ((QUERY_FLAG (tmp, FLAG_IS_HILLY) && find_skill_by_number (op, SK_CLIMBING)) || 1758 if ((QUERY_FLAG (tmp, FLAG_IS_HILLY) && find_skill_by_number (op, SK_CLIMBING)) ||
1758 (QUERY_FLAG (tmp, FLAG_IS_WOODED) && find_skill_by_number (op, SK_WOODSMAN))) 1759 (QUERY_FLAG (tmp, FLAG_IS_WOODED) && find_skill_by_number (op, SK_WOODSMAN)))
1759 diff /= 4.0; 1760 diff /= 4.0;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines