From 2d1ac1c7fa4b3ad473e9ca752a663452ed79d37b Mon Sep 17 00:00:00 2001 From: Elias Fleckenstein Date: Sun, 21 Mar 2021 19:47:13 +0100 Subject: [PATCH] Properly fix arrows crashing the server --- mods/ITEMS/mcl_bows/arrow.lua | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/mods/ITEMS/mcl_bows/arrow.lua b/mods/ITEMS/mcl_bows/arrow.lua index aefb92cca..36034cc96 100644 --- a/mods/ITEMS/mcl_bows/arrow.lua +++ b/mods/ITEMS/mcl_bows/arrow.lua @@ -16,23 +16,17 @@ local dir_to_pitch = function(dir) end local random_arrow_positions = function(positions, placement) - local min = 0 - local max = 1 if positions == 'x' then - min = -4 - max = 4 + return math.random(-4, 4) elseif positions == 'y' then - min = 0 - max = 10 + return math.random(0, 10) end if placement == 'front' and positions == 'z' then - min = 3 - max = 3 + return 3 elseif placement == 'back' and positions == 'z' then - min = -3 - max = -3 + return -3 end - return math.random(max, min) + return 0 end local mod_awards = minetest.get_modpath("awards") and minetest.get_modpath("mcl_achievements")