diff options
author | Robert Vollmert <rvollmert@gmx.net> | 2010-03-08 10:49:12 +0100 |
---|---|---|
committer | Robert Vollmert <rvollmert@gmx.net> | 2010-03-08 10:49:12 +0100 |
commit | 470eb601b659bdf6fba7f66d98e453af82300b97 (patch) | |
tree | 7131c015caa39a9f8115a0f9d40662193741b4a4 /crawl-ref/source/l_food.cc | |
parent | 86cf0da3ecec2c0a7603fc595ca65310136bdcbf (diff) | |
download | crawl-ref-470eb601b659bdf6fba7f66d98e453af82300b97.tar.gz crawl-ref-470eb601b659bdf6fba7f66d98e453af82300b97.zip |
Add lua wrapper for is_fruit.
I went with food.isfruit next to food.ischunk; it would also
have fit into the item wrapper.
Diffstat (limited to 'crawl-ref/source/l_food.cc')
-rw-r--r-- | crawl-ref/source/l_food.cc | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/crawl-ref/source/l_food.cc b/crawl-ref/source/l_food.cc index ecb7ca2772..8707eb5a1f 100644 --- a/crawl-ref/source/l_food.cc +++ b/crawl-ref/source/l_food.cc @@ -154,6 +154,13 @@ static int food_ischunk(lua_State *ls) return (1); } +static int food_isfruit(lua_State *ls) +{ + LUA_ITEM(ls, item, 1); + lua_pushboolean(ls, is_fruit(*item)); + return (1); +} + static const struct luaL_reg food_lib[] = { { "do_eat", food_do_eat }, @@ -166,6 +173,7 @@ static const struct luaL_reg food_lib[] = { "rotting", food_rotting }, { "dangerous", food_dangerous }, { "ischunk", food_ischunk }, + { "isfruit", food_isfruit }, { NULL, NULL }, }; |