Adjust explosion entity damage hitbox

In mcl_explosions the hitbox used for calculating the damage of an
entity is its collisionbox multiplied by two.  This commit removes the
multiplication by two because that makes explosion damage behave weirdly
in some circumstances.  It was most likely implemented that way because
of a misinterpretation of the Minecraft wiki.
master
Elias Åström 2021-05-08 19:59:48 +02:00 committed by nobody
parent a9d4a85e9a
commit d9bbf4879c
1 changed files with 6 additions and 6 deletions

View File

@ -253,12 +253,12 @@ local function trace_explode(pos, strength, raydirs, radius, info, puncher)
if collisionbox then
-- Create rays from random points in the collision box
local x1 = collisionbox[1] * 2
local y1 = collisionbox[2] * 2
local z1 = collisionbox[3] * 2
local x2 = collisionbox[4] * 2
local y2 = collisionbox[5] * 2
local z2 = collisionbox[6] * 2
local x1 = collisionbox[1]
local y1 = collisionbox[2]
local z1 = collisionbox[3]
local x2 = collisionbox[4]
local y2 = collisionbox[5]
local z2 = collisionbox[6]
local x_len = math.abs(x2 - x1)
local y_len = math.abs(y2 - y1)
local z_len = math.abs(z2 - z1)