diff --git a/strafe-client/src/mouse_interpolator.rs b/strafe-client/src/mouse_interpolator.rs index 33bc49c..8176b6d 100644 --- a/strafe-client/src/mouse_interpolator.rs +++ b/strafe-client/src/mouse_interpolator.rs @@ -194,16 +194,17 @@ impl MouseInterpolator{ match ins{ // could check if self.is_first_ready() StepInstruction::Pop=>self.physics_timeline.pop_front(), - StepInstruction::Timeout=>replace_with::replace_with_or_abort_and_return(&mut self.buffer_state,|buffer_state|{ + StepInstruction::Timeout=>{ + let buffer_state=core::mem::replace(&mut self.buffer_state,BufferState::Unbuffered); match buffer_state{ - BufferState::Unbuffered=>(None,BufferState::Unbuffered), + BufferState::Unbuffered=>None, BufferState::Initializing(_time,mouse_state) |BufferState::Buffered(_time,mouse_state)=>{ // convert to BufferState::Unbuffered // use the first instruction which should be a mouse instruction // to push a ReplaceMouse instruction // duplicate the current mouse - (Some(TimedInstruction{ + Some(TimedInstruction{ // This should be simulation_timer.time(timeout) // but the timer is not accessible from this scope // and it's just here to say that the mouse isn't moving anyways. @@ -211,10 +212,10 @@ impl MouseInterpolator{ instruction:PhysicsInputInstruction::Mouse( MouseInstruction::SetNextMouse(mouse_state) ), - }),BufferState::Unbuffered) + }) }, } - }), + }, } } }