diff options
author | zelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-06-10 02:34:06 +0000 |
---|---|---|
committer | zelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-06-10 02:34:06 +0000 |
commit | 1ef09d3a6fedddff10e68c836286415c45ce7dce (patch) | |
tree | 85656765f461563a48a4f52f35aeebee25c8d07b /crawl-ref/source/items.cc | |
parent | faf8f98361554b28bdcd28fb4dd0bb1c9d348380 (diff) | |
download | crawl-ref-1ef09d3a6fedddff10e68c836286415c45ce7dce.tar.gz crawl-ref-1ef09d3a6fedddff10e68c836286415c45ce7dce.zip |
Restore capability of lua scripts to change autopickup behaviour so
pickup_butcher_tool.txt can work, changed so that ')' doesn't have to be in
the autopickup line for it to work. Also changed so that it's easy for
multiple lua functions to change autopickup without stepping on each other.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5690 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/items.cc')
-rw-r--r-- | crawl-ref/source/items.cc | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/crawl-ref/source/items.cc b/crawl-ref/source/items.cc index e40aa46e59..d4ff6e63fa 100644 --- a/crawl-ref/source/items.cc +++ b/crawl-ref/source/items.cc @@ -2203,6 +2203,14 @@ static bool _is_denied_autopickup(const item_def &item, std::string &iname) if (Options.never_pickup[i].matches(iname)) return (true); +#ifdef CLUA_BINDINGS + if (clua.callbooleanfn(false, "ch_deny_autopickup", "us", + &item, iname.c_str())) + { + return (true); + } +#endif + return (false); } @@ -2215,6 +2223,14 @@ static bool _is_forced_autopickup(const item_def &item, std::string &iname) if (Options.always_pickup[i].matches(iname)) return (true); +#ifdef CLUA_BINDINGS + if (clua.callbooleanfn(false, "ch_force_autopickup", "us", + &item, iname.c_str())) + { + return (true); + } +#endif + return (false); } |