Check for damager

This commit is contained in:
NO411 2022-03-19 16:50:19 +01:00
parent d481f7b720
commit 019dd45381

View File

@ -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