mirror of
https://github.com/pandorabox-io/spacecannon.git
synced 2025-01-02 02:57:29 +01:00
damage entities
This commit is contained in:
parent
9656bc79db
commit
538c2cf718
15
cannon.lua
15
cannon.lua
@ -44,15 +44,12 @@ local register_spacecannon = function(color, range, timeout, speed)
|
|||||||
if node.name == "air" then
|
if node.name == "air" then
|
||||||
local objs = minetest.get_objects_inside_radius({x=pos.x,y=pos.y,z=pos.z}, 3)
|
local objs = minetest.get_objects_inside_radius({x=pos.x,y=pos.y,z=pos.z}, 3)
|
||||||
for k, obj in pairs(objs) do
|
for k, obj in pairs(objs) do
|
||||||
if obj:get_luaentity() ~= nil then
|
if obj:get_luaentity() ~= nil and obj:get_luaentity().name ~= self.name then
|
||||||
if obj:get_luaentity().name ~= self.name and obj:get_luaentity().name ~= "__builtin:item" then --something other found
|
obj:punch(self.object, 1.0, {
|
||||||
local mob = obj
|
full_punch_interval=1.0,
|
||||||
-- self.on_mob_hit(self,pos,mob)
|
damage_groups={fleshy=range*2},
|
||||||
end
|
}, nil)
|
||||||
elseif obj:is_player() then --player found
|
end
|
||||||
local player = obj
|
|
||||||
-- self.on_player_hit(self,pos,player)
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
elseif node.name ~= "air" then
|
elseif node.name ~= "air" then
|
||||||
-- collision
|
-- collision
|
||||||
|
Loading…
Reference in New Issue
Block a user