Tolti check inutili da get_pointed_players()

master
_Zaizen_ 2020-11-03 15:53:11 +01:00
parent 4ee0c0796e
commit 1685131113
1 changed files with 5 additions and 5 deletions

View File

@ -167,7 +167,7 @@ function block_league.get_pointed_players(head_pos, dir, range, user, particle,
-- se è un nodo mi fermo, e ritorno l'array se > 0 (ovvero ha trovato giocatori)
if hit.type == "node" then
if #players > 0 then
if particle ~= nil and particle ~= false then
if particle ~= nil then
if not has_piercing then
local impact_dist = get_dist(head_pos, players[1]:get_pos())
draw_particles(particle, dir, p1, range, impact_dist)
@ -178,7 +178,7 @@ function block_league.get_pointed_players(head_pos, dir, range, user, particle,
end
return players
else
if particle ~= nil and particle ~= false then
if particle ~= nil then
local impact_dist = get_dist(head_pos, hit.intersection_point)
draw_particles(particle, dir, p1, range, impact_dist)
end
@ -191,19 +191,19 @@ function block_league.get_pointed_players(head_pos, dir, range, user, particle,
-- se ho sparato a qualcuno senza incrociare blocchi
if #players > 0 then
if has_piercing then
if particle ~= nil and particle ~= false then
if particle ~= nil then
draw_particles(particle, dir, p1, range, 120)
end
return players
else
if particle ~= nil and particle ~= false then
if particle ~= nil then
local impact_dist = get_dist(head_pos, players[1]:get_pos())
draw_particles(particle, dir, p1, range, impact_dist)
end
return {players[1]}
end
else
if particle ~= nil and particle ~= false then
if particle ~= nil then
draw_particles(particle, dir, p1, range, 120)
end
return nil