1
0
Fork 0

Use new vectors in `mcl_blast_furnace`

Optimize_backgrounds_jpg
AFCMS 2023-06-29 21:10:31 +02:00
parent ae632fe773
commit 2cb9eca8e1
No known key found for this signature in database
GPG Key ID: 8720389A25B652E3
1 changed files with 15 additions and 15 deletions

View File

@ -183,17 +183,17 @@ local function spawn_flames(pos, param2)
local minrelpos, maxrelpos local minrelpos, maxrelpos
local dir = minetest.facedir_to_dir(param2) local dir = minetest.facedir_to_dir(param2)
if dir.x > 0 then if dir.x > 0 then
minrelpos = { x = -0.6, y = -0.05, z = -0.25 } minrelpos = vector.new(-0.6, -0.05, -0.25)
maxrelpos = { x = -0.55, y = -0.45, z = 0.25 } maxrelpos = vector.new(-0.55, -0.45, 0.25)
elseif dir.x < 0 then elseif dir.x < 0 then
minrelpos = { x = 0.55, y = -0.05, z = -0.25 } minrelpos = vector.new(0.55, -0.05, -0.25)
maxrelpos = { x = 0.6, y = -0.45, z = 0.25 } maxrelpos = vector.new(0.6, -0.45, 0.25)
elseif dir.z > 0 then elseif dir.z > 0 then
minrelpos = { x = -0.25, y = -0.05, z = -0.6 } minrelpos = vector.new(-0.25, -0.05, -0.6)
maxrelpos = { x = 0.25, y = -0.45, z = -0.55 } maxrelpos = vector.new(0.25, 0.45, -0.55)
elseif dir.z < 0 then elseif dir.z < 0 then
minrelpos = { x = -0.25, y = -0.05, z = 0.55 } minrelpos = vector.new(-0.25, -0.05, 0.55)
maxrelpos = { x = 0.25, y = -0.45, z = 0.6 } maxrelpos = vector.new(0.25, -0.45, 0.6)
else else
return return
end end
@ -202,8 +202,8 @@ local function spawn_flames(pos, param2)
time = 0, time = 0,
minpos = vector.add(pos, minrelpos), minpos = vector.add(pos, minrelpos),
maxpos = vector.add(pos, maxrelpos), maxpos = vector.add(pos, maxrelpos),
minvel = { x = -0.01, y = 0, z = -0.01 }, minvel = vector.new(-0.01, 0, -0.01),
maxvel = { x = 0.01, y = 0.1, z = 0.01 }, maxvel = vector.new(0.01, 0.1, 0.01),
minexptime = 0.3, minexptime = 0.3,
maxexptime = 0.6, maxexptime = 0.6,
minsize = 0.4, minsize = 0.4,
@ -549,11 +549,11 @@ minetest.register_node("mcl_blast_furnace:blast_furnace_active", {
for _, listname in ipairs({ "src", "dst", "fuel" }) do for _, listname in ipairs({ "src", "dst", "fuel" }) do
local stack = inv:get_stack(listname, 1) local stack = inv:get_stack(listname, 1)
if not stack:is_empty() then if not stack:is_empty() then
local p = { local p = vector.new(
x = pos.x + math.random(0, 10) / 10 - 0.5, pos.x + math.random(0, 10) / 10 - 0.5,
y = pos.y, pos.y,
z = pos.z + math.random(0, 10) / 10 - 0.5 pos.z + math.random(0, 10) / 10 - 0.5
} )
minetest.add_item(p, stack) minetest.add_item(p, stack)
end end
end end