#138 Skip nil index in mcl_shields

This commit is contained in:
kay27 2022-01-25 20:32:14 +04:00
parent a996db13d1
commit 64d760df01
1 changed files with 4 additions and 3 deletions

View File

@ -173,9 +173,10 @@ local function set_shield(player, block, i)
end end
end end
local shield = mcl_shields.players[player].shields[i] local shield = mcl_shields.players[player].shields[i]
if shield then if not shield then return end
shield:get_luaentity()._blocking = block local luaentity = shield:get_luaentity()
end if not luaentity then return end
luaentity._blocking = block
end end
local function set_interact(player, interact) local function set_interact(player, interact)