summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/maps.cc
diff options
context:
space:
mode:
Diffstat (limited to 'crawl-ref/source/maps.cc')
-rw-r--r--crawl-ref/source/maps.cc19
1 files changed, 9 insertions, 10 deletions
diff --git a/crawl-ref/source/maps.cc b/crawl-ref/source/maps.cc
index 02b45e4744..e4f598dff6 100644
--- a/crawl-ref/source/maps.cc
+++ b/crawl-ref/source/maps.cc
@@ -671,15 +671,6 @@ void read_maps()
{
if (dlua.execfile("clua/loadmaps.lua", true, true))
end(1, false, "Lua error: %s", dlua.error.c_str());
-
- for (int i = 0, size = Options.extra_levels.size(); i < size; ++i)
- {
- lc_desfile = datafile_path( Options.extra_levels[i] + ".des", false );
- if (lc_desfile.empty())
- continue;
-
- parse_maps( lc_desfile );
- }
// Clean up cached environments.
dlua.callfn("dgn_flush_map_environments", 0, 0);
@@ -751,13 +742,21 @@ static weighted_map_names mg_find_random_vaults(
}
}
- return (wms);
+ return (wms);
+}
+
+static bool weighted_map_more_likely(
+ const weighted_map_name &a,
+ const weighted_map_name &b)
+{
+ return (a.second > b.second);
}
static void mg_report_random_vaults(
FILE *outf, const level_id &place, bool wantmini)
{
weighted_map_names wms = mg_find_random_vaults(place, wantmini);
+ std::sort(wms.begin(), wms.end(), weighted_map_more_likely);
int weightsum = 0;
for (int i = 0, size = wms.size(); i < size; ++i)
weightsum += wms[i].second;