From 8e263540aeb8a60607ef445e0f7945a7831a68c1 Mon Sep 17 00:00:00 2001 From: tenplus1 Date: Fri, 16 Jun 2023 14:45:33 +0100 Subject: [PATCH] simplify round function to use vector.round --- darts.lua | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/darts.lua b/darts.lua index 3ed04c1..6fbc816 100644 --- a/darts.lua +++ b/darts.lua @@ -1,16 +1,3 @@ -local function round(n) - - if (n > 0) then - return n % 1 >= 0.5 and math.ceil(n) or math.floor(n) - else - n = -n - - local t = n % 1 >= 0.5 and math.ceil(n) or math.floor(n) - - return -t - end -end - local function duck_explosion(pos) if minetest.is_protected(pos, "") then @@ -197,7 +184,7 @@ mobs:register_arrow("nssm:morarrow", { local function explosion_web(pos, webnode) - pos.y = round(pos.y) + pos = vector.round(pos) if minetest.is_protected(pos, "") then return