version 1.12 | | version 1.13 |
---|
| | |
/* | | /* |
* static char *rcsid_object_c = | | * static char *rcsid_object_c = |
* "$Id: object.c,v 1.12 2001/01/15 22:33:32 cvs Exp $"; | | * "$Id: object.c,v 1.13 2001/01/24 05:01:36 cvs Exp $"; |
*/ | | */ |
| | |
/* | | /* |
| | |
int i,index=0; | | int i,index=0; |
static int altern[SIZEOFFREE]; | | static int altern[SIZEOFFREE]; |
for(i=start;i<stop;i++) { | | for(i=start;i<stop;i++) { |
| | /* Surprised the out_of_map check was missing. Without it, we may |
| | * end up accessing garbage, which may say a space is free |
| | */ |
| | if (out_of_map(m, x+freearr_x[i],y+freearr_y[i])) continue; |
if(!arch_blocked(at,m,x+freearr_x[i],y+freearr_y[i])) | | if(!arch_blocked(at,m,x+freearr_x[i],y+freearr_y[i])) |
altern[index++]=i; | | altern[index++]=i; |
else if(wall(m,x+freearr_x[i],y+freearr_y[i])&&maxfree[i]<stop) | | else if(wall(m,x+freearr_x[i],y+freearr_y[i])&&maxfree[i]<stop) |
| | |
| | |
int find_first_free_spot(archetype *at, mapstruct *m,int x,int y) { | | int find_first_free_spot(archetype *at, mapstruct *m,int x,int y) { |
int i; | | int i; |
for(i=0;i<SIZEOFFREE;i++) | | for(i=0;i<SIZEOFFREE;i++) { |
| | if (out_of_map(m,x+freearr_x[i],y+freearr_y[i])) continue; |
if(!arch_blocked(at,m,x+freearr_x[i],y+freearr_y[i])) | | if(!arch_blocked(at,m,x+freearr_x[i],y+freearr_y[i])) |
return i; | | return i; |
| | } |
return -1; | | return -1; |
} | | } |
| | |