fix spectator helps indexing nil sometimes

This commit is contained in:
bgkillas 2024-11-02 17:04:33 -04:00
parent 61d14f2059
commit 1c967e5ce7

View file

@ -5,7 +5,7 @@ local shield_entities = {}
rpc.opts_everywhere() rpc.opts_everywhere()
rpc.opts_reliable() rpc.opts_reliable()
function rpc.add_shield(target) function rpc.add_shield(target)
if GameHasFlagRun("ending_game_completed") then if GameHasFlagRun("ending_game_completed") or target == nil or ctx.players[target] == nil then
return return
end end
local entity = ctx.players[target].entity local entity = ctx.players[target].entity