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

Comparing deliantra/server/server/pets.C (file contents):
Revision 1.26 by root, Wed Mar 14 04:12:29 2007 UTC vs.
Revision 1.27 by elmex, Sun Apr 15 23:47:59 2007 UTC

675 LOG (llevError, "Spell %s lacks other_arch\n", &spob->name); 675 LOG (llevError, "Spell %s lacks other_arch\n", &spob->name);
676 return 0; 676 return 0;
677 } 677 }
678 678
679 if (!dir) 679 if (!dir)
680 dir = find_free_spot (NULL, op->map, op->x, op->y, 1, SIZEOFFREE1 + 1); 680 dir = find_free_spot (&at->clone, op->map, op->x, op->y, 1, SIZEOFFREE1 + 1);
681 681
682 if (dir < 0 || ob_blocked (&at->clone, op->map, op->x + freearr_x[dir], op->y + freearr_y[dir])) 682 if (dir < 0 || ob_blocked (&at->clone, op->map, op->x + freearr_x[dir], op->y + freearr_y[dir]))
683 { 683 {
684 new_draw_info (NDI_UNIQUE, 0, op, "There is something in the way."); 684 new_draw_info (NDI_UNIQUE, 0, op, "There is something in the way.");
685 return 0; 685 return 0;
712 { /* For now, we transfer ownership */ 712 { /* For now, we transfer ownership */
713 tmp->set_owner (owner); 713 tmp->set_owner (owner);
714 tmp->attack_movement = PETMOVE; 714 tmp->attack_movement = PETMOVE;
715 add_friendly_object (tmp); 715 add_friendly_object (tmp);
716 } 716 }
717 }
718 else if (caster->type == RUNE || caster->type == TRAP)
719 {
720 // if the caster is a RUNE or a TRAP remove the owner
721 // because the trap or the op (a DOOR for example) can
722 // go away. And in these cases we don't want to the pets
723 // to disappear with the owner. So: give them no owner.
724 // - this hopefully also fixes other weirdnesses with summoned golems/monsters
725 // <elmex> I'm not entirely sure whether attackmovement has to be
726 // reset to something else than PETMOVE (I don't know whether it
727 // is PETMOVE here). but at least the monsters worked when I tested.
728
729 tmp->owner = NULL;
717 } 730 }
718 731
719 SET_FLAG (tmp, FLAG_MONSTER); 732 SET_FLAG (tmp, FLAG_MONSTER);
720 } 733 }
721 734

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines