Improvements

This commit is contained in:
2022-11-26 13:52:38 -05:00
parent 512918f24c
commit cf67a8046b
46 changed files with 56 additions and 79 deletions

View File

@@ -147,7 +147,13 @@ MORE_FIRE_MOLOTOV_ENTITY.on_step = function(self, dtime)
maxsize = 0.75,
texture = 'more_fire_spark.png',
})
if self.timer>0.2 then
if node == "main:glass" then
minetest.set_node(pos.z, {name = "air"})
return
end
if self.timer > 0.1 then
local objs = minetest.get_objects_inside_radius({x=pos.x,y=pos.y,z=pos.z}, 1)
for k, obj in pairs(objs) do
if obj:get_luaentity() ~= nil then
@@ -172,7 +178,9 @@ MORE_FIRE_MOLOTOV_ENTITY.on_step = function(self, dtime)
self.object:remove()
end
else
if self.node ~= '' then
if self.node ~= '' and self.node ~= "main:glass" then
minetest.sound_play('more_fire_shatter', {gain = 1.0})
for dx=-2,2 do
for dy=-2,2 do
@@ -190,6 +198,7 @@ MORE_FIRE_MOLOTOV_ENTITY.on_step = function(self, dtime)
end
end
self.object:remove()
destruction_counter.nodesDestroyed = destruction_counter.nodesDestroyed + 20
end
end
end
@@ -214,6 +223,7 @@ MORE_FIRE_MOLOTOV_ENTITY.on_step = function(self, dtime)
end
end
self.object:remove()
destruction_counter.nodesDestroyed = destruction_counter.nodesDestroyed + 20
end
end
self.lastpos={x=pos.x, y=pos.y, z=pos.z}