mirror of
https://github.com/Noodlemire/projectile.git
synced 2024-12-04 21:03:49 +01:00
Update 1.1.3
This commit is contained in:
parent
380cac76c9
commit
acec85fd1d
@ -51,3 +51,4 @@ v1.1.3:
|
||||
|
||||
Fixes:
|
||||
-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.
|
||||
on_impact = function(self, collisions)
|
||||
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
|
||||
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 node_damage then
|
||||
local r = 4
|
||||
|
||||
if dist <= r and num > 0 then
|
||||
node_damage.damage(npos, nil, nil, num)
|
||||
for a = -r, r do
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user