diff --git a/rokit.toml b/rokit.toml index bd17d33..4b7e474 100644 --- a/rokit.toml +++ b/rokit.toml @@ -1,9 +1,6 @@ [tools] -rojo = "rojo-rbx/rojo@7.5.1" +rojo = "rojo-rbx/rojo@7.6.1" wally = "UpliftGames/wally@0.3.2" -stylua = "JohnnyMorganz/StyLua@2.1.0" -luaulsp = "JohnnyMorganz/luau-lsp@1.56.0" - -# TODO: Create Lute type definitions & switch away from Lune -# TODO: Do Lute FFI & Roblox package & switch away from Lune -lune = "lune-org/lune@0.9.4" +stylua = "JohnnyMorganz/StyLua@2.3.1" +luaulsp = "JohnnyMorganz/luau-lsp@1.57.1" +lune = "lune-org/lune@0.10.4" diff --git a/src/animation_solver.luau b/src/animation_solver.luau index 545959b..d2802ee 100644 --- a/src/animation_solver.luau +++ b/src/animation_solver.luau @@ -120,8 +120,8 @@ local function animation_solver( local time_after = pose_time_after local pointer = animation.keyframe_holes[index] and animation.keyframe_holes[index][high + 1] - if pointer then - local right_pose_pointer = pointer[2] + local right_pose_pointer = pointer and pointer[2] + if right_pose_pointer then right_pose = animation.keyframe_poses[right_pose_pointer][index] time_after = keyframe_times[right_pose_pointer] end diff --git a/src/roblox/animation_asset.luau b/src/roblox/animation_asset.luau index cef8b96..e3a6200 100644 --- a/src/roblox/animation_asset.luau +++ b/src/roblox/animation_asset.luau @@ -10,7 +10,7 @@ export type PoseNode = { } --- [1] = previous keyframe index ---- [2] = next keyframe index +--- [2] = (next keyframe index)? export type KeyframeHole = { number } export type Poses = { PoseNode } @@ -124,22 +124,20 @@ function animation_asset.load_keyframe_sequence( end future_right[limb_index] = true - -- if this is nil, the limb does not have any future keyframes - if right_pointer then - local hole = { - left_pointer, - right_pointer, - } - - local limb_holes = keframe_holes[limb_index] - if limb_holes == nil then - limb_holes = {} - keframe_holes[limb_index] = limb_holes - end + local hole = { + left_pointer, + right_pointer, + } - for fill_in = left_pointer + 1, right_pointer do - limb_holes[fill_in] = hole - end + local limb_holes = keframe_holes[limb_index] + if limb_holes == nil then + limb_holes = {} + keframe_holes[limb_index] = limb_holes + end + + -- if left_pointer, the limb does not have any future keyframes + for fill_in = left_pointer + 1, (right_pointer or #keyframe_nodes) do + limb_holes[fill_in] = hole end end end