Fix ItemStack method call for keys.

Fixes (I hope) #1420 (bad method call).
This commit is contained in:
Auke Kok 2016-11-27 14:05:28 -08:00 committed by Auke Kok
parent 0196c4793a
commit 4f32fd253c

View File

@ -1630,7 +1630,7 @@ local function has_locked_chest_privilege(meta, player)
-- is player wielding the right key?
local item = player:get_wielded_item()
if item:get_name() == "default:key" then
local key_meta = minetest.parse_json(item.get_metadata())
local key_meta = minetest.parse_json(item:get_metadata())
local secret = meta:get_string("key_lock_secret")
if secret ~= key_meta.secret then
return false