… | |
… | |
148 | if (only_subdirs) |
148 | if (only_subdirs) |
149 | style_map = 0; |
149 | style_map = 0; |
150 | else |
150 | else |
151 | { |
151 | { |
152 | strcat (style_file_path, "/"); |
152 | strcat (style_file_path, "/"); |
153 | strcat (style_file_path, namelist[RANDOM () % n]); |
153 | strcat (style_file_path, namelist[rndm (n)]); |
154 | style_map = maptile::find_sync (style_file_path); |
154 | style_map = maptile::find_sync (style_file_path); |
155 | } |
155 | } |
156 | } |
156 | } |
157 | else |
157 | else |
158 | { /* find the map closest in difficulty */ |
158 | { /* find the map closest in difficulty */ |
… | |
… | |
166 | if ((mfile_name - 1) == NULL) |
166 | if ((mfile_name - 1) == NULL) |
167 | { /* since there isn't a sequence, */ |
167 | { /* since there isn't a sequence, */ |
168 | int q; |
168 | int q; |
169 | |
169 | |
170 | /*pick one at random to recurse */ |
170 | /*pick one at random to recurse */ |
171 | style_map = find_style (style_file_path, namelist[RANDOM () % n], difficulty); |
171 | style_map = find_style (style_file_path, namelist[rndm (n)], difficulty); |
172 | for (q = 0; q < n; q++) |
172 | for (q = 0; q < n; q++) |
173 | free (namelist[q]); |
173 | free (namelist[q]); |
174 | free (namelist); |
174 | free (namelist); |
175 | return style_map; |
175 | return style_map; |
176 | } |
176 | } |
… | |
… | |
221 | * Change the logic on getting the random space - shouldn't make |
221 | * Change the logic on getting the random space - shouldn't make |
222 | * any difference, but this seems clearer to me. |
222 | * any difference, but this seems clearer to me. |
223 | */ |
223 | */ |
224 | for (int i = 1000; --i;) |
224 | for (int i = 1000; --i;) |
225 | { |
225 | { |
226 | object *new_obj = style->at (RANDOM () % style->width, RANDOM () % style->height).bot; |
226 | object *new_obj = style->at (rndm (style->width), rndm (style->height)).bot; |
227 | |
227 | |
228 | if (new_obj) |
228 | if (new_obj) |
229 | return new_obj->head_ (); |
229 | return new_obj->head_ (); |
230 | } |
230 | } |
231 | |
231 | |