From 763b3d5aa4c3c40f30f941da3a413e53f43a00c1 Mon Sep 17 00:00:00 2001 From: MihailRis Date: Sun, 7 Sep 2025 23:44:01 +0300 Subject: [PATCH] fix: mobs direction not saved --- res/scripts/components/mob.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/res/scripts/components/mob.lua b/res/scripts/components/mob.lua index 6defca42..47093852 100644 --- a/res/scripts/components/mob.lua +++ b/res/scripts/components/mob.lua @@ -40,7 +40,7 @@ local function angle_delta(a, b) return normalize_angle(a - b) end -local dir = {0, 0, -1} +local dir = mat4.mul(tsf:get_rot(), {0, 0, -1}) local flight = false function jump(multiplier) @@ -156,7 +156,7 @@ function is_flight() return flight end function set_flight(flag) flight = flag end -local prev_angle = 0.0 +local prev_angle = (vec2.angle({dir[3], dir[1]})) % 360 function on_physics_update(tps) local delta = (1.0 / tps)