forked from Mirrorlandia_minetest/tnt
Stop shadowing upvalues and definitions.
This commit is contained in:
parent
85f2dae56f
commit
d4f4156cbe
10
init.lua
10
init.lua
@ -12,7 +12,7 @@ local loss_prob = {}
|
|||||||
loss_prob["default:cobble"] = 3
|
loss_prob["default:cobble"] = 3
|
||||||
loss_prob["default:dirt"] = 4
|
loss_prob["default:dirt"] = 4
|
||||||
|
|
||||||
local radius = tonumber(minetest.setting_get("tnt_radius") or 3)
|
local tnt_radius = tonumber(minetest.setting_get("tnt_radius") or 3)
|
||||||
|
|
||||||
-- Fill a list with data for content IDs, after all nodes are registered
|
-- Fill a list with data for content IDs, after all nodes are registered
|
||||||
local cid_data = {}
|
local cid_data = {}
|
||||||
@ -345,10 +345,10 @@ local function tnt_explode(pos, radius, ignore_protection, ignore_on_blast)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
for _, data in ipairs(on_blast_queue) do
|
for _, queued_data in ipairs(on_blast_queue) do
|
||||||
local dist = math.max(1, vector.distance(data.pos, pos))
|
local dist = math.max(1, vector.distance(queued_data.pos, pos))
|
||||||
local intensity = (radius * radius) / (dist * dist)
|
local intensity = (radius * radius) / (dist * dist)
|
||||||
local node_drops = data.on_blast(data.pos, intensity)
|
local node_drops = queued_data.on_blast(queued_data.pos, intensity)
|
||||||
if node_drops then
|
if node_drops then
|
||||||
for _, item in ipairs(node_drops) do
|
for _, item in ipairs(node_drops) do
|
||||||
add_drop(drops, item)
|
add_drop(drops, item)
|
||||||
@ -589,5 +589,5 @@ end
|
|||||||
tnt.register_tnt({
|
tnt.register_tnt({
|
||||||
name = "tnt:tnt",
|
name = "tnt:tnt",
|
||||||
description = "TNT",
|
description = "TNT",
|
||||||
radius = radius,
|
radius = tnt_radius,
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user