diff options
author | Neil Moore <neil@s-z.org> | 2014-05-12 18:00:32 -0400 |
---|---|---|
committer | Neil Moore <neil@s-z.org> | 2014-05-12 18:11:14 -0400 |
commit | 9bc6d1f085097d001f0ff31f9bb900bb71957212 (patch) | |
tree | ca6c52fa82eac19c98baec7ce93b557e4d5be22e /crawl-ref/source/l_dgn.cc | |
parent | bca6d2d0ab66b008f7f1664769ba4a3a655a3444 (diff) | |
download | crawl-ref-9bc6d1f085097d001f0ff31f9bb900bb71957212.tar.gz crawl-ref-9bc6d1f085097d001f0ff31f9bb900bb71957212.zip |
Formatting fixes (add braces).
This fixes all the instances caught by unbrace.
Diffstat (limited to 'crawl-ref/source/l_dgn.cc')
-rw-r--r-- | crawl-ref/source/l_dgn.cc | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/crawl-ref/source/l_dgn.cc b/crawl-ref/source/l_dgn.cc index 7cffa6474a..b820e77b01 100644 --- a/crawl-ref/source/l_dgn.cc +++ b/crawl-ref/source/l_dgn.cc @@ -225,9 +225,11 @@ static int dgn_change_level_flags(lua_State *ls) static void _chance_magnitude_check(lua_State *ls, int which_par, int chance) { if (chance < 0 || chance > CHANCE_ROLL) + { luaL_argerror(ls, which_par, make_stringf("Chance must be in the range [0,%d]", CHANCE_ROLL).c_str()); + } } static int dgn_chance(lua_State *ls) @@ -635,10 +637,12 @@ static int dgn_map_pathfind(lua_State *ls, int minargs, MAP(ls, 1, map); const int nargs = lua_gettop(ls); if (nargs < minargs) + { return luaL_error (ls, make_stringf("Not enough points to test connectedness " "(need at least %d)", minargs / 2).c_str()); + } map_def::map_feature_finder feat_finder(*map); map_def::map_bounds_check bounds_checker(*map); @@ -1525,9 +1529,11 @@ LUAFN(dgn_with_map_anchors) for (i = 1; i < top; i += 2) { if (lua_isnumber(ls, i) && lua_isnumber(ls, i + 1)) + { map_anchor_points.push_back( coord_def(lua_tointeger(ls, i), lua_tointeger(ls, i + 1))); + } } ASSERT(lua_isfunction(ls, -1)); |