summaryrefslogtreecommitdiffstats
path: root/crawl-ref/settings
diff options
context:
space:
mode:
authorzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2008-06-10 02:34:06 +0000
committerzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2008-06-10 02:34:06 +0000
commit1ef09d3a6fedddff10e68c836286415c45ce7dce (patch)
tree85656765f461563a48a4f52f35aeebee25c8d07b /crawl-ref/settings
parentfaf8f98361554b28bdcd28fb4dd0bb1c9d348380 (diff)
downloadcrawl-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/settings')
-rw-r--r--crawl-ref/settings/pickup_butcher_tool.txt9
1 files changed, 4 insertions, 5 deletions
diff --git a/crawl-ref/settings/pickup_butcher_tool.txt b/crawl-ref/settings/pickup_butcher_tool.txt
index 0a6e5e7f3e..3257d9967d 100644
--- a/crawl-ref/settings/pickup_butcher_tool.txt
+++ b/crawl-ref/settings/pickup_butcher_tool.txt
@@ -1,8 +1,6 @@
# Pick up a butchering weapon if we don't already have one
-# This requires ) to be in the autopickup option line
< do
-local old_ch_autopickup = ch_autopickup or function() return true end
local function can_butcher(it)
if item.name(it):find("distort", 0, true) then
return false
@@ -21,7 +19,7 @@ local function can_butcher(it)
return skill:find("Blades", 0, true) or skill == "Axes"
end
end
-function ch_autopickup(it)
+function pickup_butcher(it)
if item.class(it, true) == "weapon" then
local need_blade = true
-- Trolls and Ghouls don't need weapons to butcher things, and Mummies
@@ -42,7 +40,8 @@ function ch_autopickup(it)
end
return need_blade and not item.cursed(it) and can_butcher(it)
else
- return old_ch_autopickup(it)
+ return false
end
end
-end > \ No newline at end of file
+add_autopickup_func(pickup_butcher)
+end >