From: Auke Kok Date: Thu, 31 Mar 2016 23:07:15 +0000 (-0700) Subject: Call nodeupdate on the entire blast zone X-Git-Tag: 0.4.14~34 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=a2d4e577164162102220c831b93a7eb9a974b026;p=oweals%2Fminetest_game.git Call nodeupdate on the entire blast zone This will make sand and gravel blocks on top of TNT actually fly in the air. https://youtu.be/4omndVZijLc --- diff --git a/mods/tnt/init.lua b/mods/tnt/init.lua index f4656201..a8deeb0c 100644 --- a/mods/tnt/init.lua +++ b/mods/tnt/init.lua @@ -247,6 +247,19 @@ local function tnt_explode(pos, radius, ignore_protection, ignore_on_blast) vm:update_map() vm:update_liquids() + -- call nodeupdate for everything within 1.5x blast radius + for z = -radius * 1.5, radius * 1.5 do + for x = -radius * 1.5, radius * 1.5 do + for y = -radius * 1.5, radius * 1.5 do + local s = vector.add(pos, {x = x, y = y, z = z}) + local r = vector.distance(pos, s) + if r / radius < 1.4 then + nodeupdate(s) + end + end + end + end + for _, data in ipairs(on_blast_queue) do local dist = math.max(1, vector.distance(data.pos, pos)) local intensity = (radius * radius) / (dist * dist)