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 if i == 1 then
arm = "Left" arm = "Left"
end end
local shield = mcl_shields.players[player].shields[i] local player_data = mcl_shields.players[player]
if shield then 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) shield:set_attach(player, "Arm_" .. arm, vpos, vrot, false)
end
end end
local function set_shield(player, block, i) local function set_shield(player, block, i)