version 1.8 | | version 1.9 |
---|
| | |
/* | | /* |
* static char *rcsid_wall_c = | | * static char *rcsid_wall_c = |
* "$Id: wall.c,v 1.8 2002/07/15 04:25:40 mwedel Exp $"; | | * "$Id: wall.c,v 1.9 2003/01/08 08:39:18 mwedel Exp $"; |
*/ | | */ |
| | |
/* | | /* |
| | |
8 = blocked below */ | | 8 = blocked below */ |
int surround_index = 0; | | int surround_index = 0; |
| | |
if((i > 0) && blocked(map,i-1,j)) surround_index |=1; | | if((i > 0) && (get_map_flags(map,NULL, i-1,j, NULL, NULL) & P_BLOCKED)) |
if((i < RP->Xsize-1) && blocked(map,i+1,j)) surround_index |=2; | | surround_index |=1; |
if((j > 0) && blocked(map,i,j-1)) surround_index |=4; | | if((i < RP->Xsize-1) && (get_map_flags(map,NULL, i+1,j, NULL, NULL) & P_BLOCKED)) |
if((j < RP->Ysize-1) && blocked(map,i,j+1)) surround_index |=8; | | surround_index |=2; |
| | if((j > 0) && (get_map_flags(map, NULL, i,j-1, NULL, NULL) & P_BLOCKED)) |
| | surround_index |=4; |
| | if((j < RP->Ysize-1) && (get_map_flags(map,NULL, i,j+1, NULL, NULL) & P_BLOCKED)) |
| | surround_index |=8; |
| | |
return surround_index; | | return surround_index; |
} | | } |
| | |
mapstruct *style_map=0; | | mapstruct *style_map=0; |
object *the_wall; | | object *the_wall; |
| | |
| | |
/* get the style map */ | | /* get the style map */ |
if(!strcmp(w_style,"none")) return; | | if(!strcmp(w_style,"none")) return; |
sprintf(styledirname,"%s","/styles/wallstyles"); | | sprintf(styledirname,"%s","/styles/wallstyles"); |
| | |
| | |
sprintf(RP->wall_name,"%s",the_wall->arch->name); | | sprintf(RP->wall_name,"%s",the_wall->arch->name); |
if ((cp=strchr(RP->wall_name,'_'))!=NULL) *cp=0; | | if ((cp=strchr(RP->wall_name,'_'))!=NULL) *cp=0; |
| | |
for(i=0;i<RP->Xsize;i++) | | for(i=0;i<RP->Xsize;i++) |
for(j=0;j<RP->Ysize;j++) { | | for(j=0;j<RP->Ysize;j++) { |
if(layout[i][j]=='#') { | | if(layout[i][j]=='#') { |
object *thiswall=pick_joined_wall(the_wall,layout,i,j,RP); | | object *thiswall=pick_joined_wall(the_wall,layout,i,j,RP); |
thiswall->x = i; thiswall->y = j; | | |
| | thiswall->x = i; |
| | thiswall->y = j; |
SET_FLAG(thiswall,FLAG_NO_PASS); /* make SURE it's a wall */ | | SET_FLAG(thiswall,FLAG_NO_PASS); /* make SURE it's a wall */ |
wall(map,i,j); | | |
insert_ob_in_map(thiswall,map,thiswall,INS_NO_MERGE | INS_NO_WALK_ON); | | insert_ob_in_map(thiswall,map,thiswall,INS_NO_MERGE | INS_NO_WALK_ON); |
} | | } |
} | | } |
} | | } |
| | |
| | |
} | | } |
| | |
| | |