From 019dd4538187ba19968fc13826c928db607c9895 Mon Sep 17 00:00:00 2001 From: NO411 Date: Sat, 19 Mar 2022 16:50:19 +0100 Subject: [PATCH] Check for damager --- mods/ITEMS/mcl_shields/init.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mods/ITEMS/mcl_shields/init.lua b/mods/ITEMS/mcl_shields/init.lua index ad859f9c3..78afae710 100644 --- a/mods/ITEMS/mcl_shields/init.lua +++ b/mods/ITEMS/mcl_shields/init.lua @@ -137,6 +137,10 @@ mcl_damage.register_modifier(function(obj, damage, reason) damager = entity._shooter end + if not damager then + return + end + if vector.dot(obj:get_look_dir(), vector.subtract(damager:get_pos(), obj:get_pos())) < 0 then return end