summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorBardur Arantsson <bardur@scientician.net>2012-03-31 21:28:05 +0200
committerBardur Arantsson <bardur@scientician.net>2012-04-02 21:42:56 +0200
commit39af619fc0ffd2804a009cd70cc7cfd7ad352ff4 (patch)
tree0af482cdee18f9683114278764ea899d57199a78 /lib
parenta6c3015b17efb98c8fb595f7be237c5a5cb52ce3 (diff)
Remove unused Lua function have_object()
Diffstat (limited to 'lib')
-rw-r--r--lib/core/s_aux.lua41
-rw-r--r--lib/mods/theme/core/s_aux.lua41
2 files changed, 0 insertions, 82 deletions
diff --git a/lib/core/s_aux.lua b/lib/core/s_aux.lua
index 1cc74765..4cc4a199 100644
--- a/lib/core/s_aux.lua
+++ b/lib/core/s_aux.lua
@@ -531,47 +531,6 @@ function cast_school_spell(s, s_ptr, no_cost)
end
--- Helper functions
-HAVE_ARTIFACT = 0
-HAVE_OBJECT = 1
-HAVE_EGO = 2
-function have_object(mode, type, find, find2)
- local o, i, min, max
-
- max = 0
- min = 0
- if band(mode, USE_EQUIP) == USE_EQUIP then
- min = INVEN_WIELD
- max = INVEN_TOTAL
- end
- if band(mode, USE_INVEN) == USE_INVEN then
- min = 0
- if max == 0 then max = INVEN_WIELD end
- end
-
- i = min
- while i < max do
- o = get_object(i)
- if o.k_idx ~= 0 then
- if type == HAVE_ARTIFACT then
- if find == o.name1 then return i end
- end
- if type == HAVE_OBJECT then
- if find2 == nil then
- if find == o.k_idx then return i end
- else
- if (find == o.tval) and (find2 == o.sval) then return i end
- end
- end
- if type == HAVE_EGO then
- if (find == o.name2) or (find == o.name2b) then return i end
- end
- end
- i = i + 1
- end
- return -1
-end
-
-- Can the spell be randomly found(in random books)
function can_spell_random(i)
return __tmp_spells[i].random
diff --git a/lib/mods/theme/core/s_aux.lua b/lib/mods/theme/core/s_aux.lua
index 1cc74765..4cc4a199 100644
--- a/lib/mods/theme/core/s_aux.lua
+++ b/lib/mods/theme/core/s_aux.lua
@@ -531,47 +531,6 @@ function cast_school_spell(s, s_ptr, no_cost)
end
--- Helper functions
-HAVE_ARTIFACT = 0
-HAVE_OBJECT = 1
-HAVE_EGO = 2
-function have_object(mode, type, find, find2)
- local o, i, min, max
-
- max = 0
- min = 0
- if band(mode, USE_EQUIP) == USE_EQUIP then
- min = INVEN_WIELD
- max = INVEN_TOTAL
- end
- if band(mode, USE_INVEN) == USE_INVEN then
- min = 0
- if max == 0 then max = INVEN_WIELD end
- end
-
- i = min
- while i < max do
- o = get_object(i)
- if o.k_idx ~= 0 then
- if type == HAVE_ARTIFACT then
- if find == o.name1 then return i end
- end
- if type == HAVE_OBJECT then
- if find2 == nil then
- if find == o.k_idx then return i end
- else
- if (find == o.tval) and (find2 == o.sval) then return i end
- end
- end
- if type == HAVE_EGO then
- if (find == o.name2) or (find == o.name2b) then return i end
- end
- end
- i = i + 1
- end
- return -1
-end
-
-- Can the spell be randomly found(in random books)
function can_spell_random(i)
return __tmp_spells[i].random