mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2024-12-25 17:39:33 +01:00
Merge pull request 'Fix #2336 (interaction bug when opening chests)' (#2340) from shield_fixes into master
Reviewed-on: https://git.minetest.land/MineClone2/MineClone2/pulls/2340
This commit is contained in:
commit
0b197d3605
1 changed files with 8 additions and 1 deletions
|
@ -275,9 +275,16 @@ local function handle_blocking(player)
|
||||||
player_shield.blocking = 2
|
player_shield.blocking = 2
|
||||||
end
|
end
|
||||||
elseif shield_in_offhand then
|
elseif shield_in_offhand then
|
||||||
local offhand_can_block = (wielded_item(player) == "" or not mcl_util.get_pointed_thing(player, true))
|
local pointed_thing = mcl_util.get_pointed_thing(player, true)
|
||||||
|
local offhand_can_block = (wielded_item(player) == "" or not pointed_thing)
|
||||||
and (minetest.get_item_group(wielded_item(player), "bow") ~= 1 and minetest.get_item_group(wielded_item(player), "crossbow") ~= 1)
|
and (minetest.get_item_group(wielded_item(player), "bow") ~= 1 and minetest.get_item_group(wielded_item(player), "crossbow") ~= 1)
|
||||||
|
|
||||||
|
if pointed_thing and pointed_thing.type == "node" then
|
||||||
|
if minetest.get_item_group(minetest.get_node(pointed_thing.under).name, "container") > 1 then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
if not offhand_can_block then
|
if not offhand_can_block then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue