… | |
… | |
80 | * Since this is part of the random map code, presumption |
80 | * Since this is part of the random map code, presumption |
81 | * is that this is not a tiled map. |
81 | * is that this is not a tiled map. |
82 | * What is considered blocking and not is somewhat hard coded. |
82 | * What is considered blocking and not is somewhat hard coded. |
83 | */ |
83 | */ |
84 | int |
84 | int |
85 | surround_flag3 (mapstruct *map, sint16 i, sint16 j, RMParms * RP) |
85 | surround_flag3 (maptile *map, sint16 i, sint16 j, RMParms * RP) |
86 | { |
86 | { |
87 | /* |
87 | /* |
88 | * 1 = blocked to left, |
88 | * 1 = blocked to left, |
89 | * 2 = blocked to right, |
89 | * 2 = blocked to right, |
90 | * 4 = blocked above |
90 | * 4 = blocked above |
… | |
… | |
106 | } |
106 | } |
107 | |
107 | |
108 | /* like surround_flag2, except it checks a map, not a layout. */ |
108 | /* like surround_flag2, except it checks a map, not a layout. */ |
109 | |
109 | |
110 | int |
110 | int |
111 | surround_flag4 (mapstruct *map, int i, int j, RMParms * RP) |
111 | surround_flag4 (maptile *map, int i, int j, RMParms * RP) |
112 | { |
112 | { |
113 | /* 1 = blocked to left, |
113 | /* 1 = blocked to left, |
114 | 2 = blocked to right, |
114 | 2 = blocked to right, |
115 | 4 = blocked above |
115 | 4 = blocked above |
116 | 8 = blocked below */ |
116 | 8 = blocked below */ |
… | |
… | |
130 | |
130 | |
131 | /* takes a map and a layout, and puts walls in the map (picked from |
131 | /* takes a map and a layout, and puts walls in the map (picked from |
132 | w_style) at '#' marks. */ |
132 | w_style) at '#' marks. */ |
133 | |
133 | |
134 | void |
134 | void |
135 | make_map_walls (mapstruct *map, char **layout, char *w_style, RMParms * RP) |
135 | make_map_walls (maptile *map, char **layout, char *w_style, RMParms * RP) |
136 | { |
136 | { |
137 | char styledirname[256]; |
137 | char styledirname[256]; |
138 | char stylefilepath[256]; |
138 | char stylefilepath[256]; |
139 | mapstruct *style_map = 0; |
139 | maptile *style_map = 0; |
140 | object *the_wall; |
140 | object *the_wall; |
141 | |
141 | |
142 | /* get the style map */ |
142 | /* get the style map */ |
143 | if (!strcmp (w_style, "none")) |
143 | if (!strcmp (w_style, "none")) |
144 | return; |
144 | return; |
… | |
… | |
288 | * remove anything. It depends on the |
288 | * remove anything. It depends on the |
289 | * global, previously-set variable, "wall_name" |
289 | * global, previously-set variable, "wall_name" |
290 | */ |
290 | */ |
291 | |
291 | |
292 | object * |
292 | object * |
293 | retrofit_joined_wall (mapstruct *the_map, int i, int j, int insert_flag, RMParms * RP) |
293 | retrofit_joined_wall (maptile *the_map, int i, int j, int insert_flag, RMParms * RP) |
294 | { |
294 | { |
295 | /* 1 = wall to left, |
295 | /* 1 = wall to left, |
296 | * 2 = wall to right, |
296 | * 2 = wall to right, |
297 | * 4 = wall above |
297 | * 4 = wall above |
298 | * 8 = wall below |
298 | * 8 = wall below |
… | |
… | |
302 | object *the_wall = 0; |
302 | object *the_wall = 0; |
303 | object *new_wall = 0; |
303 | object *new_wall = 0; |
304 | archetype *wall_arch = 0; |
304 | archetype *wall_arch = 0; |
305 | |
305 | |
306 | /* first find the wall */ |
306 | /* first find the wall */ |
307 | for (the_wall = get_map_ob (the_map, i, j); the_wall != NULL; the_wall = the_wall->above) |
307 | for (the_wall = GET_MAP_OB (the_map, i, j); the_wall != NULL; the_wall = the_wall->above) |
308 | if ((the_wall->move_type & MOVE_WALK) && the_wall->type != EXIT && the_wall->type != TELEPORTER) |
308 | if ((the_wall->move_type & MOVE_WALK) && the_wall->type != EXIT && the_wall->type != TELEPORTER) |
309 | break; |
309 | break; |
310 | |
310 | |
311 | |
311 | |
312 | /* if what we found is a door, don't remove it, set the_wall to NULL to |
312 | /* if what we found is a door, don't remove it, set the_wall to NULL to |
… | |
… | |
395 | new_wall = arch_to_object (wall_arch); |
395 | new_wall = arch_to_object (wall_arch); |
396 | new_wall->x = i; |
396 | new_wall->x = i; |
397 | new_wall->y = j; |
397 | new_wall->y = j; |
398 | if (the_wall && the_wall->map) |
398 | if (the_wall && the_wall->map) |
399 | { |
399 | { |
400 | remove_ob (the_wall); |
400 | the_wall->remove (); |
401 | free_object (the_wall); |
401 | the_wall->destroy (); |
402 | } |
402 | } |
403 | the_wall->move_block = MOVE_ALL; |
403 | the_wall->move_block = MOVE_ALL; |
404 | insert_ob_in_map (new_wall, the_map, new_wall, INS_NO_MERGE | INS_NO_WALK_ON); |
404 | insert_ob_in_map (new_wall, the_map, new_wall, INS_NO_MERGE | INS_NO_WALK_ON); |
405 | } |
405 | } |
406 | else |
406 | else |