From d5ea06bb474eca8de2637b644aeb5158d77d1847 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elias=20=C3=85str=C3=B6m?= Date: Tue, 16 Feb 2021 21:33:26 +0100 Subject: [PATCH] Fix center of bounding box calculation --- mods/CORE/mcl_explosions/init.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mods/CORE/mcl_explosions/init.lua b/mods/CORE/mcl_explosions/init.lua index b2348986..02044dc9 100644 --- a/mods/CORE/mcl_explosions/init.lua +++ b/mods/CORE/mcl_explosions/init.lua @@ -255,9 +255,9 @@ local function trace_explode(pos, strength, raydirs, radius, info, puncher) local z_len = math.abs(z2 - z1) -- Move object position to the center of its bounding box - opos.x = opos.x + x1 + x2 - opos.y = opos.y + y1 + y2 - opos.z = opos.z + z1 + z2 + opos.x = opos.x + 0.5 * (x1 + x2) + opos.y = opos.y + 0.5 * (y1 + y2) + opos.z = opos.z + 0.5 * (z1 + z2) -- Count number of rays from collision box which are unobstructed local count = N_EXPOSURE_RAYS