fix vca duration calculation

This commit is contained in:
MihailRis 2026-09-05 23:51:56 +03:00
parent 7f15cd897c
commit 2104bc7670
2 changed files with 8 additions and 2 deletions

View file

@ -1,3 +1,5 @@
local ALMOST_HUGE = 1e9
local rig = entity.skeleton
local states = {}
@ -50,7 +52,11 @@ local function update(delta)
state.track = state.track or animation.get_track(state.track_id)
if state.track and intensity > 0.0 then
state.track.func(rig, state.timer, intensity * state.max_intencity)
state.track.func(
rig,
state.timer % math.min(ALMOST_HUGE, state.track.duration),
intensity * state.max_intencity
)
end
end
end