diff options
author | haranp <haranp@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-04-21 16:18:19 +0000 |
---|---|---|
committer | haranp <haranp@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-04-21 16:18:19 +0000 |
commit | fac344b62ebbf48e7b1d2a7b5f0bcdd3608bd4a7 (patch) | |
tree | 8cc8a0b1312414c79f2c2d6e3d1e455754be41ea /crawl-ref/source/clua.cc | |
parent | b2ea8143ccf52a2cacfa48d19ce2ea603ddaab5e (diff) | |
download | crawl-ref-fac344b62ebbf48e7b1d2a7b5f0bcdd3608bd4a7.tar.gz crawl-ref-fac344b62ebbf48e7b1d2a7b5f0bcdd3608bd4a7.zip |
Eliminated it_name(), in_name(), item_name(). The function to use is
now item_def::name().
Cleaned up a lot of code in the process.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1341 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/clua.cc')
-rw-r--r-- | crawl-ref/source/clua.cc | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/crawl-ref/source/clua.cc b/crawl-ref/source/clua.cc index 326a91ff73..634d4e2740 100644 --- a/crawl-ref/source/clua.cc +++ b/crawl-ref/source/clua.cc @@ -1158,7 +1158,7 @@ static int l_item_worn(lua_State *ls) return (2); } -static int desc_code(const char *desc) +static description_level_type desc_code(const char *desc) { if (!desc) return DESC_PLAIN; @@ -1190,14 +1190,11 @@ static int l_item_name(lua_State *ls) LUA_ITEM(item, 1); if (item) { - int ndesc = DESC_PLAIN; + description_level_type ndesc = DESC_PLAIN; if (lua_isstring(ls, 2)) ndesc = desc_code(lua_tostring(ls, 2)); bool terse = lua_toboolean(ls, 3); - char bufitemname[ITEMNAME_SIZE]; - item_name(*item, ndesc, bufitemname, terse); - - lua_pushstring(ls, bufitemname); + lua_pushstring(ls, item->name(ndesc, terse).c_str()); } else lua_pushnil(ls); |