From e7970ecce53814546495b7fca76a019b256a315d Mon Sep 17 00:00:00 2001 From: cora Date: Thu, 7 Apr 2022 22:19:39 +0200 Subject: [PATCH] shields: Fix crash when deflecting ghast fireball --- mods/ITEMS/mcl_shields/init.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mods/ITEMS/mcl_shields/init.lua b/mods/ITEMS/mcl_shields/init.lua index f10a49c8c..5f5e78e38 100644 --- a/mods/ITEMS/mcl_shields/init.lua +++ b/mods/ITEMS/mcl_shields/init.lua @@ -140,8 +140,8 @@ mcl_damage.register_modifier(function(obj, damage, reason) if not damager then return end - - if vector.dot(obj:get_look_dir(), vector.subtract(damager:get_pos(), obj:get_pos())) < 0 then + local dpos = damager:get_pos() + if dpos and vector.dot(obj:get_look_dir(), vector.subtract(dpos, obj:get_pos())) < 0 then return end