Update 5
parent
d01da1c3b9
commit
de8380fd7b
|
@ -19,7 +19,7 @@ quake.register_grenade("quake:grenade", {
|
|||
textures = {"quake_bullet_rocket.png"},
|
||||
collisionbox = {-0.3, -0.3, -0.3, 0.3, 0.3, 0.3},
|
||||
explosion_range = 4,
|
||||
duration = 3,
|
||||
duration = 2,
|
||||
gravity = true,
|
||||
on_destroy = quake.grenade_explode,
|
||||
particle = {
|
||||
|
|
|
@ -97,14 +97,25 @@ function get_pointed_players(head_pos, dir, dist, username)
|
|||
-- check su ogni cosa attraversata dal raycast (p1 a p2)
|
||||
for hit in ray do
|
||||
-- se è un oggetto
|
||||
if hit.type == "object" and hit.ref then
|
||||
if hit.type == "object" then
|
||||
if hit.ref then
|
||||
-- se è un giocatore
|
||||
if hit.ref:is_player() then
|
||||
-- e non è colui che spara
|
||||
if hit.ref:get_player_name() ~= username then
|
||||
table.insert(players, hit.ref)
|
||||
end
|
||||
end
|
||||
if hit.ref:is_player() then
|
||||
-- e non è colui che spara
|
||||
if hit.ref:get_player_name() ~= username then
|
||||
table.insert(players, hit.ref)
|
||||
end
|
||||
elseif hit.ref:get_luaentity() then
|
||||
local entity = hit.ref:get_luaentity()
|
||||
if entity.initial_properties ~= nil then
|
||||
|
||||
if entity.initial_properties.is_bullet or entity.initial_properties.is_grenade then
|
||||
--distrugge sia il proiettile con cui collide che se stesso
|
||||
entity:_destroy()
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
else
|
||||
-- se è un nodo mi fermo, e ritorno l'array se > 0 (ovvero ha trovato giocatori)
|
||||
if hit.type == "node" then
|
||||
|
|
Loading…
Reference in New Issue