Fix yet another crash in shields line 158

This commit is contained in:
kay27 2022-03-06 05:55:09 +04:00
parent abe2bde998
commit a605a7afe7
1 changed files with 7 additions and 4 deletions

View File

@ -155,10 +155,13 @@ local function modify_shield(player, vpos, vrot, i)
if i == 1 then
arm = "Left"
end
local shield = mcl_shields.players[player].shields[i]
if shield then
shield:set_attach(player, "Arm_" .. arm, vpos, vrot, false)
end
local player_data = mcl_shields.players[player]
if not player_data then return end
local shields = player_data.shields
if not shields then return end
local shield = shields[i]
if not shield then return end
shield:set_attach(player, "Arm_" .. arm, vpos, vrot, false)
end
local function set_shield(player, block, i)