Skip to content

Commit

Permalink
Make SetSequence work with seeking as well
Browse files Browse the repository at this point in the history
marchc1 committed Jan 13, 2025
1 parent 132dd5b commit 84e970b
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions lua/ponder/classes_cl/playback.lua
Original file line number Diff line number Diff line change
@@ -201,6 +201,10 @@ function Ponder.Playback:GetInstructionProgress(instruction)
return math.Clamp(math.Remap(self.Time, curChapTime + instruction.Time, curChapTime + instruction.Time + instruction.Length, 0, 1), 0, 1)
end

function Ponder.Playback:GetInstructionStartTime(instruction)
return instruction.Chapter.StartTime + instruction.Time
end

function Ponder.Playback:SetChapter(chapterIndex)
local oldC = self.Chapter or 1

2 changes: 1 addition & 1 deletion lua/ponder/instructions_cl/models/ponder.setsequence.lua
Original file line number Diff line number Diff line change
@@ -12,7 +12,7 @@ function SetSequence:First(playback)
self.SequenceDuration = object:SequenceDuration(object:LookupSequence(self.Sequence))
self.Length = self.Loop and 0 or self.SequenceDuration
object:SetSequence(self.Sequence)
local start = playback.Time
local start = playback:GetInstructionStartTime(self)
hook.Add("Think", object, function()
if not IsValid(object) then return end

0 comments on commit 84e970b

Please sign in to comment.