From 5d8bcde2aeb73774490bb72f9b4e40252ed7645a Mon Sep 17 00:00:00 2001 From: tenplus1 Date: Wed, 18 Dec 2024 13:02:23 +0000 Subject: [PATCH] math local --- spider.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/spider.lua b/spider.lua index 7050d4b..9b39049 100644 --- a/spider.lua +++ b/spider.lua @@ -13,6 +13,8 @@ local function get_velocity(self) return (v.x * v.x + v.z * v.z) ^ 0.5 end +local math_cos, math_sin = math.cos, math.sin + -- custom spider types local spider_types = { @@ -168,8 +170,8 @@ mobs:register_mob("mobs_monster:spider", { pos.y = pos.y + prop.collisionbox[2] - 0.2 - local dir_x = -math.sin(yaw) * (prop.collisionbox[4] + 0.5) - local dir_z = math.cos(yaw) * (prop.collisionbox[4] + 0.5) + local dir_x = -math_sin(yaw) * (prop.collisionbox[4] + 0.5) + local dir_z = math_cos(yaw) * (prop.collisionbox[4] + 0.5) local nod = minetest.get_node_or_nil({ x = pos.x + dir_x, y = pos.y + 0.5,