sorcery  interop.lua at [9278734b41]

File interop.lua artifact b53d891f54 part of check-in 9278734b41


-- override the protection function to handle the
-- sealing spell and amulets
do local nextfn = minetest.is_protected
	minetest.is_protected = function(pos,name)
		local meta = minetest.get_meta(pos)
		if meta:contains('owner') and meta:contains('sorcery_wand_key') then
			if meta:get_string('sorcery_seal_mode') == 'wand' or name ~= meta:get_string('owner') then
				return true
			end
		end
		return nextfn(pos,name)
	end
end