diff --git a/strafe-client/src/session.rs b/strafe-client/src/session.rs index b5b8ba3..17a0d7e 100644 --- a/strafe-client/src/session.rs +++ b/strafe-client/src/session.rs @@ -99,7 +99,7 @@ impl Recording{ } } pub struct Replay{ - last_instruction_id:usize, + next_instruction_id:usize, recording:Recording, simulation:Simulation, } @@ -109,7 +109,7 @@ impl Replay{ simulation:Simulation, )->Self{ Self{ - last_instruction_id:0, + next_instruction_id:0, recording, simulation, } @@ -117,16 +117,16 @@ impl Replay{ pub fn advance(&mut self,physics_data:&PhysicsData,time_limit:SessionTime){ let mut time=self.simulation.timer.time(time_limit); loop{ - if let Some(ins)=self.recording.instructions.get(self.last_instruction_id){ + if let Some(ins)=self.recording.instructions.get(self.next_instruction_id){ if ins.time> for Session{ let time=replay.simulation.timer.time(ins.time+SessionTime::from_secs(5)); replay.simulation.timer.set_time(ins.time,time); // resimulate the entire playback lol - replay.last_instruction_id=0; + replay.next_instruction_id=0; }, } },