version 1.34 | | version 1.35 |
---|
| | |
/* | | /* |
* static char *rcsid_pets_c = | | * static char *rcsid_pets_c = |
* "$Id: pets.c,v 1.34 2005/08/12 13:46:34 ryo_saeba Exp $"; | | * "$Id: pets.c,v 1.35 2005/09/13 06:46:35 mwedel Exp $"; |
*/ | | */ |
| | |
/* | | /* |
| | |
if ((check_enemy(owner,rv)) == pet) { | | if ((check_enemy(owner,rv)) == pet) { |
CLEAR_FLAG(pet, FLAG_FRIENDLY); | | CLEAR_FLAG(pet, FLAG_FRIENDLY); |
remove_friendly_object(pet); | | remove_friendly_object(pet); |
pet->move_type &=~PETMOVE; | | pet->attack_movement &=~PETMOVE; |
return owner; | | return owner; |
} | | } |
} else { | | } else { |
| | |
*/ | | */ |
CLEAR_FLAG(pet, FLAG_FRIENDLY); | | CLEAR_FLAG(pet, FLAG_FRIENDLY); |
remove_friendly_object(pet); | | remove_friendly_object(pet); |
pet->move_type &=~PETMOVE; | | pet->attack_movement &=~PETMOVE; |
return NULL; | | return NULL; |
} | | } |
/* If they are not on the same map, the pet won't be agressive */ | | /* If they are not on the same map, the pet won't be agressive */ |
| | |
object *owner = get_owner(op); | | object *owner = get_owner(op); |
if(owner != NULL) {/* For now, we transfer ownership */ | | if(owner != NULL) {/* For now, we transfer ownership */ |
set_owner(tmp,owner); | | set_owner(tmp,owner); |
tmp->move_type = PETMOVE; | | tmp->attack_movement = PETMOVE; |
add_friendly_object(tmp); | | add_friendly_object(tmp); |
SET_FLAG(tmp, FLAG_FRIENDLY); | | SET_FLAG(tmp, FLAG_FRIENDLY); |
} | | } |
} | | } |
} | | } |
if(op->type!=PLAYER || !is_golem) { | | if(op->type!=PLAYER || !is_golem) { |
tmp->move_type = PETMOVE; | | tmp->attack_movement = PETMOVE; |
tmp->speed_left = -1; | | tmp->speed_left = -1; |
tmp->type = 0; | | tmp->type = 0; |
tmp->enemy = op->enemy; | | tmp->enemy = op->enemy; |
| | |
object *owner = get_owner(op); | | object *owner = get_owner(op); |
if (owner != NULL) { /* For now, we transfer ownership */ | | if (owner != NULL) { /* For now, we transfer ownership */ |
set_owner (tmp, owner); | | set_owner (tmp, owner); |
tmp->move_type = PETMOVE; | | tmp->attack_movement = PETMOVE; |
add_friendly_object (tmp); | | add_friendly_object (tmp); |
SET_FLAG (tmp, FLAG_FRIENDLY); | | SET_FLAG (tmp, FLAG_FRIENDLY); |
} | | } |
| | |
SET_FLAG(tmp, FLAG_FRIENDLY); | | SET_FLAG(tmp, FLAG_FRIENDLY); |
add_friendly_object(tmp); | | add_friendly_object(tmp); |
tmp->stats.exp = 0; | | tmp->stats.exp = 0; |
if (spell_ob->move_type) | | if (spell_ob->attack_movement) |
tmp->move_type = spell_ob->move_type; | | tmp->attack_movement = spell_ob->attack_movement; |
if (get_owner(op)) | | if (get_owner(op)) |
set_owner(tmp, get_owner(op)); | | set_owner(tmp, get_owner(op)); |
} | | } |