diff options
author | Jude Brown <bookofjude@users.sourceforge.net> | 2010-01-24 21:49:43 +1000 |
---|---|---|
committer | Jude Brown <bookofjude@users.sourceforge.net> | 2010-01-24 22:07:52 +1000 |
commit | d15f7f13d9e7e69c66665b788f95bc2ed30a1e77 (patch) | |
tree | 3adb50433f841e6db6627204903e81c32149663f /crawl-ref/source/l_dgnit.cc | |
parent | 6f65497b7f71cc4ad6c7f8a17f782093824482b3 (diff) | |
download | crawl-ref-d15f7f13d9e7e69c66665b788f95bc2ed30a1e77.tar.gz crawl-ref-d15f7f13d9e7e69c66665b788f95bc2ed30a1e77.zip |
Convert items Lua library to use metatable. May case end-user issues.
Like the monster library, the item library now uses a metatable to store
its functions. Instead of using lightuserdata, as before, and passing
this to the different item.* functions, the functions are now members of
the actual item.
The item library has also been renamed to "items": this allows for its
use in Vault definitions without it clashing with the item specifier and
dgn.item function.
Example:
* Previously, you would use:
local x = item.inventory()[1]
print(item.name(x, false))
* Now, you would use:
local x = items.inventory()[1]
print(x.name(false))
This will have an impact on end-user scripts that use the old version of
the item library. I have already updated the uses of the items library
in the dat/lua scripts, as well as vault definitions and marker
definitions. I think I've caught them all.
There may be bugs or issues, but hopefully that's everything. (Does
cause issues with annotations such as {artefact}, will be fixed
shortly.)
Diffstat (limited to 'crawl-ref/source/l_dgnit.cc')
-rw-r--r-- | crawl-ref/source/l_dgnit.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/crawl-ref/source/l_dgnit.cc b/crawl-ref/source/l_dgnit.cc index 2438dd9ca2..4ac0c50266 100644 --- a/crawl-ref/source/l_dgnit.cc +++ b/crawl-ref/source/l_dgnit.cc @@ -66,7 +66,7 @@ static int dgn_item_from_index(lua_State *ls) static int dgn_items_at(lua_State *ls) { COORDS(c, 1, 2); - lua_push_items(ls, env.igrid(c)); + lua_push_floor_items(ls, env.igrid(c)); return (1); } |