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.42 by root, Sat Jan 5 03:44:59 2008 UTC vs.
Revision 1.43 by root, Tue Jan 22 16:22:45 2008 UTC

31 * this is now tilemap aware. 31 * this is now tilemap aware.
32 */ 32 */
33object * 33object *
34get_pet_enemy (object *pet, rv_vector * rv) 34get_pet_enemy (object *pet, rv_vector * rv)
35{ 35{
36 object *owner, *tmp, *attacker, *tmp3; 36 object *tmp, *attacker, *tmp3;
37 int i; 37 int i;
38 sint16 x, y; 38 sint16 x, y;
39 maptile *nm; 39 maptile *nm;
40 int search_arr[SIZEOFFREE]; 40 int search_arr[SIZEOFFREE];
41 int mflags; 41 int mflags;
42 42
43 attacker = pet->attacked_by; /*pointer to attacking enemy */ 43 attacker = pet->attacked_by; /*pointer to attacking enemy */
44 pet->attacked_by = NULL; /*clear this, since we are dealing with it */ 44 pet->attacked_by = NULL; /*clear this, since we are dealing with it */
45 45
46 if (owner = pet->owner) 46 object *owner = pet->owner;
47 { 47
48 /* If the owner has turned on the pet, make the pet 48 if (!owner)
49 * unfriendly.
50 */
51 if (check_enemy (owner, rv) == pet)
52 {
53 remove_friendly_object (pet);
54 pet->attack_movement &= ~PETMOVE;
55 return owner;
56 }
57 } 49 {
58 else
59 {
60 /* else the owner is no longer around, so the 50 /* the owner is no longer around, so the
61 * pet no longer needs to be friendly. 51 * pet no longer needs to be friendly.
62 */ 52 */
63 remove_friendly_object (pet); 53 remove_friendly_object (pet);
64 pet->attack_movement &= ~PETMOVE; 54 pet->attack_movement &= ~PETMOVE;
65 return 0; 55 return 0;
56 }
57
58 /* If the owner has turned on the pet, make the pet
59 * unfriendly.
60 */
61 if (check_enemy (owner, rv) == pet)
62 {
63 remove_friendly_object (pet);
64 pet->attack_movement &= ~PETMOVE;
65 return owner;
66 } 66 }
67 67
68 /* If they are not on the same map, the pet won't be agressive */ 68 /* If they are not on the same map, the pet won't be agressive */
69 //if (!on_same_map (pet, owner)) 69 //if (!on_same_map (pet, owner))
70 // return 0; 70 // return 0;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines