Check for damager
This commit is contained in:
parent
d481f7b720
commit
019dd45381
|
@ -137,6 +137,10 @@ mcl_damage.register_modifier(function(obj, damage, reason)
|
||||||
damager = entity._shooter
|
damager = entity._shooter
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if not damager then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
if vector.dot(obj:get_look_dir(), vector.subtract(damager:get_pos(), obj:get_pos())) < 0 then
|
if vector.dot(obj:get_look_dir(), vector.subtract(damager:get_pos(), obj:get_pos())) < 0 then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue
Block a user