From 3ad8a6a473afcdfccdc675fd4eb771f9a9d4897d Mon Sep 17 00:00:00 2001 From: Lars Date: Sat, 25 May 2024 14:15:31 -0700 Subject: [PATCH] Fix possible invalid object reference in TNT mod --- mods/tnt/init.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mods/tnt/init.lua b/mods/tnt/init.lua index 622b6c97..ab438a5c 100644 --- a/mods/tnt/init.lua +++ b/mods/tnt/init.lua @@ -159,6 +159,7 @@ local function entity_physics(pos, radius, drops) local objs = minetest.get_objects_inside_radius(pos, radius) for _, obj in pairs(objs) do local obj_pos = obj:get_pos() + if obj_pos then local dist = math.max(1, vector.distance(pos, obj_pos)) local damage = (4 / dist) * radius @@ -200,6 +201,7 @@ local function entity_physics(pos, radius, drops) end end end + end end end