master
_Zaizen_ 2020-08-06 23:35:27 +02:00
parent 6f4872283f
commit 39ff103f82
1 changed files with 25 additions and 25 deletions

View File

@ -2,7 +2,7 @@ quake.explode = function(self)
local explosion_range = self.initial_properties.explosion_range
local explosion_damage = self.initial_properties.explosion_damage
local origin = self.object:get_pos()
local objs = minetest.env:get_objects_inside_radius(origin, explosion_range)
local objs = minetest:get_objects_inside_radius(origin, explosion_range)
-- se ho colpito qualcosa
if objs then
@ -24,19 +24,19 @@ quake.explode = function(self)
quake.shoot(self.p_name, obj, (damage/5), false)
end
end
--[[
elseif obj:get_luaentity() then
local entity = obj: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()
self:_destroy()
return
local entity = obj: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()
return
end
end
end
end
]]
end
end
end
end
@ -46,7 +46,8 @@ quake.grenade_explode = function(self)
local explosion_range = self.initial_properties.explosion_range
local explosion_damage = self.initial_properties.explosion_damage
local origin = self.object:get_pos()
local objs = minetest.env:get_objects_inside_radius(origin, explosion_range)
if origin.x == nil or origin.y == nil or origin.z == nil then return end
local objs = minetest:get_objects_inside_radius(origin, explosion_range)
-- se ho colpito qualcosa
if objs then
@ -61,23 +62,22 @@ quake.grenade_explode = function(self)
local dist = math.sqrt((hypot * hypot) + (leny * leny))
local damage = explosion_damage - (explosion_damage * dist / explosion_range)
quake.shoot(self.p_name, obj, damage, false)
end
elseif obj:get_luaentity() then
local entity = obj: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()
self:_destroy()
return
end
--[[
elseif obj:get_luaentity() then
local entity = obj: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()
return
end
end
end
]]
end
end
end
end
end