version 1.27 | | version 1.28 |
---|
| | |
/* | | /* |
* static char *rcsid_disease_c = | | * static char *rcsid_disease_c = |
* "$Id: disease.c,v 1.27 2003/09/13 05:02:09 mwedel Exp $"; | | * "$Id: disease.c,v 1.28 2004/08/20 20:02:10 akirschbaum Exp $"; |
*/ | | */ |
/* | | /* |
CrossFire, A Multiplayer game for X-windows | | CrossFire, A Multiplayer game for X-windows |
| | |
/* searches around for more victims to infect */ | | /* searches around for more victims to infect */ |
int check_infection(object *disease) { | | int check_infection(object *disease) { |
int x,y,range, mflags; | | int x,y,range, mflags; |
mapstruct *map; | | mapstruct *map, *map2; |
object *tmp; | | object *tmp; |
sint16 i,j; | | sint16 i, j, i2, j2; |
| | |
range = abs(disease->magic); | | range = abs(disease->magic); |
if(disease->env) { | | if(disease->env) { |
| | |
if(map == NULL) return 0; | | if(map == NULL) return 0; |
for(i=x-range;i<x+range;i++) { | | for(i=x-range;i<x+range;i++) { |
for(j=y-range;j<y+range;j++) { | | for(j=y-range;j<y+range;j++) { |
mflags = get_map_flags(map,&map, i,j, &i, &j); | | mflags = get_map_flags(map,&map2, i,j, &i2, &j2); |
if (!(mflags & P_OUT_OF_MAP) && (mflags & P_IS_ALIVE)) { | | if (!(mflags & P_OUT_OF_MAP) && (mflags & P_IS_ALIVE)) { |
for(tmp=get_map_ob(map,i,j);tmp;tmp=tmp->above) { | | for(tmp=get_map_ob(map2,i2,j2);tmp;tmp=tmp->above) { |
infect_object(tmp,disease,0); | | infect_object(tmp,disease,0); |
} | | } |
} | | } |