… | |
… | |
65 | else |
65 | else |
66 | { |
66 | { |
67 | vdoors = find_style ("/styles/doorstyles/vdoors", doorstyle, -1); |
67 | vdoors = find_style ("/styles/doorstyles/vdoors", doorstyle, -1); |
68 | if (!vdoors) |
68 | if (!vdoors) |
69 | return; |
69 | return; |
|
|
70 | |
70 | sprintf (doorpath, "/styles/doorstyles/hdoors%s", strrchr (vdoors->path, '/')); |
71 | sprintf (doorpath, "/styles/doorstyles/hdoors%s", strrchr (vdoors->path, '/')); |
71 | hdoors = find_style (doorpath, 0, -1); |
72 | hdoors = find_style (doorpath, 0, -1); |
|
|
73 | if (!hdoors) |
|
|
74 | return; |
72 | } |
75 | } |
73 | |
76 | |
74 | for (i = 0; i < RP->Xsize; i++) |
77 | for (i = 0; i < RP->Xsize; i++) |
75 | for (j = 0; j < RP->Ysize; j++) |
78 | for (j = 0; j < RP->Ysize; j++) |
76 | { |
79 | { |
… | |
… | |
79 | int sindex; |
82 | int sindex; |
80 | object *this_door, *new_door; |
83 | object *this_door, *new_door; |
81 | |
84 | |
82 | sindex = surround_check2 (maze, i, j, RP->Xsize, RP->Ysize); |
85 | sindex = surround_check2 (maze, i, j, RP->Xsize, RP->Ysize); |
83 | if (sindex == 3) |
86 | if (sindex == 3) |
84 | this_door = pick_random_object (hdoors); |
87 | this_door = hdoors->pick_random_object (); |
85 | else |
88 | else |
86 | this_door = pick_random_object (vdoors); |
89 | this_door = vdoors->pick_random_object (); |
87 | |
90 | |
88 | if (!this_door) |
91 | if (!this_door) |
89 | abort (); |
92 | abort (); |
90 | |
93 | |
91 | new_door = arch_to_object (this_door->arch); |
94 | new_door = arch_to_object (this_door->arch); |
… | |
… | |
94 | new_door->y = j; |
97 | new_door->y = j; |
95 | insert_ob_in_map (new_door, the_map, NULL, 0); |
98 | insert_ob_in_map (new_door, the_map, NULL, 0); |
96 | } |
99 | } |
97 | } |
100 | } |
98 | } |
101 | } |
|
|
102 | |