fix seek when paused

This commit is contained in:
2026-02-27 08:10:16 -08:00
parent 3644dd7f15
commit a4c4f20bad
4 changed files with 18 additions and 4 deletions

View File

@@ -1,5 +1,6 @@
use strafesnet_common::instruction::TimedInstruction;
use strafesnet_common::session::Time as SessionTime;
use strafesnet_common::timer::TimerState;
use strafesnet_roblox_bot_player::{bot::CompleteBot,graphics::Graphics,head::{PlaybackHead,Time as PlaybackTime}};
pub enum SessionControlInstruction{
@@ -57,11 +58,11 @@ impl<'a> PlayerWorker<'a>{
self.playback_head.set_time(bot,ins.time,PlaybackTime::ZERO);
},
Instruction::SessionControl(SessionControlInstruction::SkipForward)=>if let Some(bot)=&self.bot{
let head_time=self.playback_head.time(ins.time+SessionTime::from_secs(2));
let head_time=self.playback_head.timer().clone().into_state().0.get_time(ins.time+SessionTime::from_secs(2));
self.playback_head.set_time(bot,ins.time,head_time);
},
Instruction::SessionControl(SessionControlInstruction::SkipBack)=>if let Some(bot)=&self.bot{
let head_time=self.playback_head.time(ins.time-SessionTime::from_secs(2));
let head_time=self.playback_head.timer().clone().into_state().0.get_time(ins.time-SessionTime::from_secs(2));
self.playback_head.set_time(bot,ins.time,head_time);
},
Instruction::SessionControl(SessionControlInstruction::DecreaseTimescale)=>{