version 1.39 | | version 1.40 |
---|
| | |
/* | | /* |
* static char *rcsid_pets_c = | | * static char *rcsid_pets_c = |
* "$Id: pets.c,v 1.39 2005/11/16 08:16:09 mwedel Exp $"; | | * "$Id: pets.c,v 1.40 2005/12/10 14:27:10 akirschbaum Exp $"; |
*/ | | */ |
| | |
/* | | /* |
| | |
sint16 x,y; | | sint16 x,y; |
mapstruct *nm; | | mapstruct *nm; |
int search_arr[SIZEOFFREE]; | | int search_arr[SIZEOFFREE]; |
| | int mflags; |
| | |
attacker = pet->attacked_by; /*pointer to attacking enemy*/ | | attacker = pet->attacked_by; /*pointer to attacking enemy*/ |
pet->attacked_by = NULL; /*clear this, since we are dealing with it*/ | | pet->attacked_by = NULL; /*clear this, since we are dealing with it*/ |
| | |
y = owner->y + freearr_y[search_arr[i]]; | | y = owner->y + freearr_y[search_arr[i]]; |
nm = owner->map; | | nm = owner->map; |
/* Only look on the space if there is something alive there. */ | | /* Only look on the space if there is something alive there. */ |
if (get_map_flags(nm, &nm, x, y, &x, &y) & P_IS_ALIVE) { | | mflags = get_map_flags(nm, &nm, x, y, &x, &y); |
| | if (!(mflags & P_OUT_OF_MAP) && mflags & P_IS_ALIVE) { |
for (tmp = get_map_ob(nm, x, y); tmp != NULL; tmp = tmp->above) { | | for (tmp = get_map_ob(nm, x, y); tmp != NULL; tmp = tmp->above) { |
object *tmp2 = tmp->head == NULL?tmp:tmp->head; | | object *tmp2 = tmp->head == NULL?tmp:tmp->head; |
| | |
| | |
y = pet->y + freearr_y[search_arr[i]]; | | y = pet->y + freearr_y[search_arr[i]]; |
nm = pet->map; | | nm = pet->map; |
/* Only look on the space if there is something alive there. */ | | /* Only look on the space if there is something alive there. */ |
if (get_map_flags(nm, &nm, x,y, &x, &y) & P_IS_ALIVE) { | | mflags = get_map_flags(nm, &nm, x,y, &x, &y); |
| | if (!(mflags & P_OUT_OF_MAP) && mflags & P_IS_ALIVE) { |
for (tmp = get_map_ob(nm, x, y); tmp != NULL; tmp = tmp->above) { | | for (tmp = get_map_ob(nm, x, y); tmp != NULL; tmp = tmp->above) { |
object *tmp2 = tmp->head == NULL?tmp:tmp->head; | | object *tmp2 = tmp->head == NULL?tmp:tmp->head; |
if (QUERY_FLAG(tmp2,FLAG_ALIVE) && (( | | if (QUERY_FLAG(tmp2,FLAG_ALIVE) && (( |