diff options
author | Robert Vollmert <rvollmert@gmx.net> | 2009-11-03 10:58:07 +0100 |
---|---|---|
committer | Robert Vollmert <rvollmert@gmx.net> | 2009-11-03 10:58:07 +0100 |
commit | 41878a6a0e11f6b7c782e67e68ec04d1b3347df7 (patch) | |
tree | 2781e3ad619049f0cdfe6840250115628fe2e071 /crawl-ref/source/l_dgngrd.cc | |
parent | 712c03631e8ff844a399246a9ae96f071f818e46 (diff) | |
download | crawl-ref-41878a6a0e11f6b7c782e67e68ec04d1b3347df7.tar.gz crawl-ref-41878a6a0e11f6b7c782e67e68ec04d1b3347df7.zip |
Restore lua binding for in_bounds.
It's now in the more fitting l_dgngrd.cc.
Diffstat (limited to 'crawl-ref/source/l_dgngrd.cc')
-rw-r--r-- | crawl-ref/source/l_dgngrd.cc | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/crawl-ref/source/l_dgngrd.cc b/crawl-ref/source/l_dgngrd.cc index 7bb9a42e09..39f33d76f5 100644 --- a/crawl-ref/source/l_dgngrd.cc +++ b/crawl-ref/source/l_dgngrd.cc @@ -206,6 +206,15 @@ static int dgn_max_bounds(lua_State *ls) return (2); } +static int dgn_in_bounds(lua_State *ls) +{ + int x = luaL_checkint(ls, 1); + int y = luaL_checkint(ls, 2); + + lua_pushboolean(ls, in_bounds(x, y)); + return 1; +} + static int dgn_grid(lua_State *ls) { GETCOORD(c, 1, 2, map_bounds); @@ -251,6 +260,7 @@ const struct luaL_reg dgn_grid_dlib[] = { "is_opaque", _dgn_is_opaque }, { "is_wall", _dgn_is_wall }, { "max_bounds", dgn_max_bounds }, +{ "in_bounds", dgn_in_bounds }, { "distance", dgn_distance }, { NULL, NULL } |