mirror of
https://github.com/LoneWolfHT/grenades.git
synced 2024-11-22 14:53:46 +01:00
Few more flashbang updates
This commit is contained in:
parent
e67f8cc2f1
commit
7d0964950a
@ -41,8 +41,8 @@ if settings:get_bool("enable_flashbang_grenade") then
|
|||||||
on_explode = function(pos, player, self)
|
on_explode = function(pos, player, self)
|
||||||
for k, v in ipairs(minetest.get_objects_inside_radius(pos, 15)) do
|
for k, v in ipairs(minetest.get_objects_inside_radius(pos, 15)) do
|
||||||
if v:is_player() and v:get_hp() > 0 then
|
if v:is_player() and v:get_hp() > 0 then
|
||||||
local playerdir = vector.floor(vector.normalize(v:get_look_dir()))
|
local playerdir = vector.round(vector.normalize(v:get_look_dir()))
|
||||||
local grenadedir = vector.floor(vector.normalize(vector.direction(v:get_pos(), pos)))
|
local grenadedir = vector.round(vector.normalize(vector.direction(v:get_pos(), pos)))
|
||||||
|
|
||||||
if playerdir.x == grenadedir.x and playerdir.z == grenadedir.z then
|
if playerdir.x == grenadedir.x and playerdir.z == grenadedir.z then
|
||||||
for i = 1, 3, 1 do
|
for i = 1, 3, 1 do
|
||||||
|
Loading…
Reference in New Issue
Block a user