diff options
author | shivajiva101 <shivajiva101@hotmail.com> | 2017-11-20 01:52:34 +0000 |
---|---|---|
committer | Ekdohibs <nathanael.courant@laposte.net> | 2018-01-03 11:15:53 +0100 |
commit | 2ab5a7c90a59db14c60bdb07d306eac89987e9f5 (patch) | |
tree | 3889e24157bfa08f39ea58dd8ff5bac60c414314 | |
parent | 86c73a4752fab05f538d969bb8433dce52180749 (diff) |
fix excessive privilege checkorigin/masterorigin/HEAD
-rw-r--r-- | internal.lua | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/internal.lua b/internal.lua index 5732971..4e78a89 100644 --- a/internal.lua +++ b/internal.lua @@ -290,6 +290,7 @@ function unified_inventory.apply_filter(player, filter, search_dir) return string.find(lname, lfilter, 1, true) or string.find(ldesc, lfilter, 1, true) end end + local is_creative = unified_inventory.is_creative(player_name) unified_inventory.filtered_items_list[player_name]={} for name, def in pairs(minetest.registered_items) do if (not def.groups.not_in_creative_inventory @@ -297,8 +298,7 @@ function unified_inventory.apply_filter(player, filter, search_dir) and def.description and def.description ~= "" and ffilter(name, def) - and (unified_inventory.is_creative(player_name) - or unified_inventory.crafts_for.recipe[def.name]) then + and (is_creative or unified_inventory.crafts_for.recipe[def.name]) then table.insert(unified_inventory.filtered_items_list[player_name], name) end end |