Update 1.1.3
parent
380cac76c9
commit
acec85fd1d
|
@ -51,3 +51,4 @@ v1.1.3:
|
||||||
|
|
||||||
Fixes:
|
Fixes:
|
||||||
-A crash that could occur from pulverizing a charging weapon.
|
-A crash that could occur from pulverizing a charging weapon.
|
||||||
|
-node_damage mod not actually being optional, and causing a crash when not included.
|
||||||
|
|
23
init.lua
23
init.lua
|
@ -485,19 +485,22 @@ if tnt then
|
||||||
--Upon impact, create a small explosion.
|
--Upon impact, create a small explosion.
|
||||||
on_impact = function(self, collisions)
|
on_impact = function(self, collisions)
|
||||||
local pos = self.object:get_pos()
|
local pos = self.object:get_pos()
|
||||||
local r = 4
|
|
||||||
|
|
||||||
tnt.boom(self.object:get_pos(), {radius = 2, damage_radius = 2})
|
tnt.boom(pos, {radius = 2, damage_radius = 2})
|
||||||
|
|
||||||
for a = -r, r do
|
if node_damage then
|
||||||
for b = -r, r do
|
local r = 4
|
||||||
for c = -r, r do
|
|
||||||
local npos = vector.add(pos, {x=a, y=b, z=c})
|
|
||||||
local dist = vector.distance(pos, npos)
|
|
||||||
local num = math.random(0, math.ceil(r / math.max(1, dist)))
|
|
||||||
|
|
||||||
if dist <= r and num > 0 then
|
for a = -r, r do
|
||||||
node_damage.damage(npos, nil, nil, num)
|
for b = -r, r do
|
||||||
|
for c = -r, r do
|
||||||
|
local npos = vector.add(pos, {x=a, y=b, z=c})
|
||||||
|
local dist = vector.distance(pos, npos)
|
||||||
|
local num = math.random(0, math.ceil(r / math.max(1, dist)))
|
||||||
|
|
||||||
|
if dist <= r and num > 0 then
|
||||||
|
node_damage.damage(npos, nil, nil, num)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue