summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/maps.cc
diff options
context:
space:
mode:
authordshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-07-06 18:55:32 +0000
committerdshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-07-06 18:55:32 +0000
commit942fcc618e384eed001f538abe28912fd0d468d3 (patch)
treedb8fd9c4c50d98bc8820c516e5b8bd0fa9fb0e36 /crawl-ref/source/maps.cc
parent50c3e7b2427a5f93e0bcc763beb3130e4d2bc265 (diff)
downloadcrawl-ref-942fcc618e384eed001f538abe28912fd0d468d3.tar.gz
crawl-ref-942fcc618e384eed001f538abe28912fd0d468d3.zip
Fix level compiler to validate PLACE: declarations.
Places are saved as level_ids, not strings. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1776 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/maps.cc')
-rw-r--r--crawl-ref/source/maps.cc10
1 files changed, 5 insertions, 5 deletions
diff --git a/crawl-ref/source/maps.cc b/crawl-ref/source/maps.cc
index 7b387941ce..95eee85414 100644
--- a/crawl-ref/source/maps.cc
+++ b/crawl-ref/source/maps.cc
@@ -281,9 +281,9 @@ static int apply_vault_definition(
// Map lookups
// Returns a map for which PLACE: matches the given place.
-int random_map_for_place(const std::string &place, bool want_minivault)
+int random_map_for_place(const level_id &place, bool want_minivault)
{
- if (place.empty())
+ if (!place.is_valid())
return (-1);
int mapindex = -1;
@@ -293,7 +293,7 @@ int random_map_for_place(const std::string &place, bool want_minivault)
{
// We also accept tagged levels here.
if (vdefs[i].place == place
- && vdefs[i].is_minivault() == want_minivault)
+ && vdefs[i].is_minivault() == want_minivault)
{
rollsize += vdefs[i].chance;
@@ -305,13 +305,13 @@ int random_map_for_place(const std::string &place, bool want_minivault)
#ifdef DEBUG_DIAGNOSTICS
if (mapindex != -1)
mprf(MSGCH_DIAGNOSTICS, "Found map %s for %s",
- vdefs[mapindex].name.c_str(), place.c_str());
+ vdefs[mapindex].name.c_str(), place.describe().c_str());
#endif
return (mapindex);
}
-int random_map_for_depth(const level_id &place, bool want_minivault)
+int random_map_in_depth(const level_id &place, bool want_minivault)
{
int mapindex = -1;
int rollsize = 0;