| 2241 | } |
| 2242 | |
| 2243 | void map_def::reinit() |
| 2244 | { |
| 2245 | description.clear(); |
| 2246 | order = INT_MAX; |
| 2247 | items.clear(); |
| 2248 | random_mons.clear(); |
| 2249 | |
| 2250 | rock_colour = floor_colour = BLACK; |
| 2251 | rock_tile = floor_tile = ""; |
| 2252 | border_fill_type = DNGN_ROCK_WALL; |
| 2253 | |
| 2254 | // Chance of using this level. Nonzero chance should be used |
| 2255 | // sparingly. When selecting vaults for a place, first those |
| 2256 | // vaults with chance > 0 are considered, in the order they were |
| 2257 | // loaded (which is arbitrary). If random2(100) < chance, the |
| 2258 | // vault is picked, and all other vaults are ignored for that |
| 2259 | // random selection. weight is ignored if the vault is chosen |
| 2260 | // based on its chance. |
| 2261 | _chance.clear(); |
| 2262 | |
| 2263 | // Weight for this map. When selecting a map, if no map with a |
| 2264 | // nonzero chance is picked, one of the other eligible vaults is |
| 2265 | // picked with a probability of weight / (sum of weights of all |
| 2266 | // eligible vaults). |
| 2267 | _weight.clear(DEFAULT_MAP_WEIGHT); |
| 2268 | |
| 2269 | // Clearing the map also zaps map transforms. |
| 2270 | map.clear(); |
| 2271 | mons.clear(); |
| 2272 | feat_renames.clear(); |
| 2273 | subvault_places.clear(); |
| 2274 | update_cached_tags(); |
| 2275 | } |
| 2276 | |
| 2277 | void map_def::reload_epilogue() |
| 2278 | { |
no test coverage detected