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.42 by root, Thu Sep 14 01:19:47 2006 UTC vs.
Revision 1.43 by root, Thu Sep 14 17:10:24 2006 UTC

515{ 515{
516 LOG (llevDebug, "%d allocated objects\n", nrofallocobjects); 516 LOG (llevDebug, "%d allocated objects\n", nrofallocobjects);
517} 517}
518 518
519/* 519/*
520 * Returns the object which this object marks as being the owner.
521 * A id-scheme is used to avoid pointing to objects which have been
522 * freed and are now reused. If this is detected, the owner is
523 * set to NULL, and NULL is returned.
524 * Changed 2004-02-12 - if the player is setting at the play again
525 * prompt, he is removed, and we don't want to treat him as an owner of
526 * anything, so check removed flag. I don't expect that this should break
527 * anything - once an object is removed, it is basically dead anyways.
528 */
529object *
530object::get_owner ()
531{
532 if (!owner
533 || QUERY_FLAG (owner, FLAG_FREED)
534 || QUERY_FLAG (owner, FLAG_REMOVED))
535 owner = 0;
536
537 return owner;
538}
539
540/*
541 * Sets the owner and sets the skill and exp pointers to owner's current 520 * Sets the owner and sets the skill and exp pointers to owner's current
542 * skill and experience objects. 521 * skill and experience objects.
543 */ 522 */
544void 523void
545object::set_owner (object *owner) 524object::set_owner (object *owner)
612 591
613 /* What is not cleared is next, prev, and count */ 592 /* What is not cleared is next, prev, and count */
614 593
615 expmul = 1.0; 594 expmul = 1.0;
616 face = blank_face; 595 face = blank_face;
617 attacked_by_count = -1;
618 596
619 if (settings.casting_time) 597 if (settings.casting_time)
620 casting_time = -1; 598 casting_time = -1;
621} 599}
622 600
945{ 923{
946 SET_FLAG (this, FLAG_REMOVED); 924 SET_FLAG (this, FLAG_REMOVED);
947 925
948 expmul = 1.0; 926 expmul = 1.0;
949 face = blank_face; 927 face = blank_face;
950 attacked_by_count = -1;
951} 928}
952 929
953object::~object () 930object::~object ()
954{ 931{
955 free_key_values (this); 932 free_key_values (this);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines