1
0
Fork 0

core:explosions: fix blast radius rounding

mc rounds to nearest int, do the same
simplify the calculation
This commit is contained in:
bakawun 2023-12-12 00:39:00 +01:00
parent aff4216ccf
commit 12c2807807
1 changed files with 1 additions and 1 deletions

View File

@ -459,7 +459,7 @@ function mcl_explosions.explode(pos, strength, info, direct, source)
end
-- The maximum blast radius (in the air)
local radius = math.ceil(1.3 * strength / (0.3 * 0.75) * 0.3)
local radius = math.floor(1.3 * strength / 0.225 * 0.3 + 0.5)
if not sphere_shapes[radius] then
sphere_shapes[radius] = compute_sphere_rays(radius)