mirror of
https://github.com/minetest/minetest_game.git
synced 2024-12-22 14:12:26 +01:00
Fix possible invalid object reference in TNT mod
This commit is contained in:
parent
1ce48351ea
commit
3ad8a6a473
@ -159,6 +159,7 @@ local function entity_physics(pos, radius, drops)
|
|||||||
local objs = minetest.get_objects_inside_radius(pos, radius)
|
local objs = minetest.get_objects_inside_radius(pos, radius)
|
||||||
for _, obj in pairs(objs) do
|
for _, obj in pairs(objs) do
|
||||||
local obj_pos = obj:get_pos()
|
local obj_pos = obj:get_pos()
|
||||||
|
if obj_pos then
|
||||||
local dist = math.max(1, vector.distance(pos, obj_pos))
|
local dist = math.max(1, vector.distance(pos, obj_pos))
|
||||||
|
|
||||||
local damage = (4 / dist) * radius
|
local damage = (4 / dist) * radius
|
||||||
@ -202,6 +203,7 @@ local function entity_physics(pos, radius, drops)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
local function add_effects(pos, radius, drops)
|
local function add_effects(pos, radius, drops)
|
||||||
minetest.add_particle({
|
minetest.add_particle({
|
||||||
|
Loading…
Reference in New Issue
Block a user