Skip to content

Commit 6e345cf

Browse files
authoredJun 2, 2020
Use node particles for TNT explosions (#2695)
1 parent e849d54 commit 6e345cf

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed
 

Diff for: ‎mods/tnt/init.lua

+8-2
Original file line numberDiff line numberDiff line change
@@ -234,12 +234,16 @@ local function add_effects(pos, radius, drops)
234234
-- we just dropped some items. Look at the items entities and pick
235235
-- one of them to use as texture
236236
local texture = "tnt_blast.png" --fallback texture
237+
local node
237238
local most = 0
238239
for name, stack in pairs(drops) do
239240
local count = stack:get_count()
240241
if count > most then
241242
most = count
242243
local def = minetest.registered_nodes[name]
244+
if def then
245+
node = { name = name }
246+
end
243247
if def and def.tiles and def.tiles[1] then
244248
texture = def.tiles[1]
245249
end
@@ -257,9 +261,11 @@ local function add_effects(pos, radius, drops)
257261
maxacc = {x = 0, y = -10, z = 0},
258262
minexptime = 0.8,
259263
maxexptime = 2.0,
260-
minsize = radius * 0.66,
261-
maxsize = radius * 2,
264+
minsize = radius * 0.33,
265+
maxsize = radius,
262266
texture = texture,
267+
-- ^ only as fallback for clients without support for `node` parameter
268+
node = node,
263269
collisiondetection = true,
264270
})
265271
end

0 commit comments

Comments
 (0)
Please sign in to comment.