From b5680b52823bbbb629735b4fe01922a33eafc290 Mon Sep 17 00:00:00 2001 From: LoneWolfHT Date: Thu, 22 Nov 2018 18:36:48 -0800 Subject: [PATCH] Improve flashbang 'is player looing at it' calculations --- grenades.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/grenades.lua b/grenades.lua index 32c0258..8013819 100644 --- a/grenades.lua +++ b/grenades.lua @@ -41,8 +41,8 @@ if settings:get_bool("enable_flashbang_grenade") then on_explode = function(pos, player, self) for k, v in ipairs(minetest.get_objects_inside_radius(pos, 15)) do if v:is_player() and v:get_hp() > 0 then - local playerdir = vector.round(vector.normalize(v:get_look_dir())) - local grenadedir = vector.round(vector.normalize(vector.direction(v:get_pos(), pos))) + local playerdir = vector.round(v:get_look_dir()) + local grenadedir = vector.round(vector.direction(v:get_pos(), pos)) if playerdir.x == grenadedir.x and playerdir.z == grenadedir.z then for i = 1, 3, 1 do