summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/luadgn.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/luadgn.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/luadgn.cc')
-rw-r--r--crawl-ref/source/luadgn.cc13
1 files changed, 11 insertions, 2 deletions
diff --git a/crawl-ref/source/luadgn.cc b/crawl-ref/source/luadgn.cc
index 6507066111..f50420b7ef 100644
--- a/crawl-ref/source/luadgn.cc
+++ b/crawl-ref/source/luadgn.cc
@@ -353,9 +353,18 @@ static int dgn_place(lua_State *ls)
if (lua_isnil(ls, 2))
map->place.clear();
else
- map->place = luaL_checkstring(ls, 2);
+ {
+ try
+ {
+ map->place = level_id::parse_level_id(luaL_checkstring(ls, 2));
+ }
+ catch (const std::string &err)
+ {
+ luaL_error(ls, err.c_str());
+ }
+ }
}
- PLUARET(string, map->place.c_str());
+ PLUARET(string, map->place.describe().c_str());
}
static int dgn_tags(lua_State *ls)