update mod.conf, fix nil bug
This commit is contained in:
parent
f517964ce0
commit
1cfac454c0
@ -6,12 +6,12 @@ minetest.register_entity(fname, {
|
||||
velocity = 0.1,
|
||||
damage = dmg,
|
||||
collisionbox = {0, 0, 0, 0, 0, 0},
|
||||
on_step = function(self, obj, pos)
|
||||
local remove = minetest.after(2, function()
|
||||
on_step = function(self, obj, pos)
|
||||
local remove = minetest.after(2, function()
|
||||
self.object:remove()
|
||||
end)
|
||||
local pos = self.object:get_pos()
|
||||
local objs = minetest.get_objects_inside_radius({x=pos.x,y=pos.y,z=pos.z}, 2)
|
||||
local objs = minetest.get_objects_inside_radius({x=pos.x,y=pos.y,z=pos.z}, 2)
|
||||
for k, obj in pairs(objs) do
|
||||
if obj:get_luaentity() ~= nil then
|
||||
if obj:get_luaentity().name ~= fname and obj:get_luaentity().name ~= "dmobs:dragon_red" and obj:get_luaentity().name ~= "dmobs:dragon_blue" and obj:get_luaentity().name ~= "dmobs:dragon_black" and obj:get_luaentity().name ~= "dmobs:dragon_green" and obj:get_luaentity().name ~= "dmobs:dragon_great_tame" and obj:get_luaentity().name ~= "__builtin:item" then
|
||||
@ -29,7 +29,7 @@ minetest.register_entity(fname, {
|
||||
local p = {x=pos.x+dx, y=pos.y, z=pos.z+dz}
|
||||
local t = {x=pos.x+dx, y=pos.y+dy, z=pos.z+dz}
|
||||
local n = minetest.get_node(p).name
|
||||
if n ~= fname and n ~="default:dirt_with_grass" and n ~="default:dirt_with_dry_grass" and n ~="default:stone" then
|
||||
if n ~= fname and n ~="default:dirt_with_grass" and n ~="default:dirt_with_dry_grass" and n ~="default:stone" then
|
||||
if minetest.registered_nodes[n].groups.flammable --[[or math.random(1, 100) <= 1]] then
|
||||
minetest.set_node(t, {name=replace_node})
|
||||
self.object:remove()
|
||||
@ -43,24 +43,23 @@ minetest.register_entity(fname, {
|
||||
end
|
||||
end
|
||||
end
|
||||
local apos = self.object:get_pos()
|
||||
local part = minetest.add_particlespawner(
|
||||
6, --amount
|
||||
0.3, --time
|
||||
{x=apos.x-variance, y=apos.y-variance, z=apos.z-variance}, --minpos
|
||||
{x=apos.x+variance, y=apos.y+variance, z=apos.z+variance}, --maxpos
|
||||
{x=-0, y=-0, z=-0}, --minvel
|
||||
{x=0, y=0, z=0}, --maxvel
|
||||
{x=variance,y=-0.5-variance,z=variance}, --minacc
|
||||
{x=0.5+variance,y=0.5+variance,z=0.5+variance}, --maxacc
|
||||
0.1, --minexptime
|
||||
0.3, --maxexptime
|
||||
size, --minsize
|
||||
size+2, --maxsize
|
||||
false, --collisiondetection
|
||||
texture --texture
|
||||
)
|
||||
|
||||
local apos = self.object:get_pos() ; if not apos then return end
|
||||
minetest.add_particlespawner({
|
||||
amount = 6,
|
||||
time = 0.3,
|
||||
minpos = {x=apos.x-variance, y=apos.y-variance, z=apos.z-variance},
|
||||
maxpos = {x=apos.x+variance, y=apos.y+variance, z=apos.z+variance},
|
||||
minvel = {x=-0, y=-0, z=-0},
|
||||
maxvel = {x=0, y=0, z=0},
|
||||
minacc = {x=variance,y=-0.5-variance,z=variance},
|
||||
maxacc = {x=0.5+variance,y=0.5+variance,z=0.5+variance},
|
||||
minexptime = 0.1,
|
||||
maxexptime = 0.3,
|
||||
minsize = size,
|
||||
maxsize = size+2,
|
||||
collisiondetection = false,
|
||||
texture = texture
|
||||
})
|
||||
end,
|
||||
})
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user