diff --git a/strafe-client/src/session.rs b/strafe-client/src/session.rs index 7cccf38..4503aa1 100644 --- a/strafe-client/src/session.rs +++ b/strafe-client/src/session.rs @@ -286,11 +286,11 @@ impl InstructionConsumer> for Session{ ViewState::Play=>{ // allow simulation timescale for fun let scale=self.simulation.timer.get_scale(); - self.simulation.timer.set_scale(ins.time,scale*5/4); + self.simulation.timer.set_scale(ins.time,strafesnet_common::integer::Ratio64::new(scale.num()*5,scale.den()*4).unwrap()); }, ViewState::Replay(bot_id)=>if let Some(replay)=self.replays.get_mut(bot_id){ let scale=replay.simulation.timer.get_scale(); - replay.simulation.timer.set_scale(ins.time,scale*5/4); + replay.simulation.timer.set_scale(ins.time,strafesnet_common::integer::Ratio64::new(scale.num()*5,scale.den()*4).unwrap()); }, } }, @@ -299,11 +299,11 @@ impl InstructionConsumer> for Session{ ViewState::Play=>{ // allow simulation timescale for fun let scale=self.simulation.timer.get_scale(); - self.simulation.timer.set_scale(ins.time,scale*4/5); + self.simulation.timer.set_scale(ins.time,strafesnet_common::integer::Ratio64::new(scale.num()*4,scale.den()*5).unwrap()); }, ViewState::Replay(bot_id)=>if let Some(replay)=self.replays.get_mut(bot_id){ let scale=replay.simulation.timer.get_scale(); - replay.simulation.timer.set_scale(ins.time,scale*4/5); + replay.simulation.timer.set_scale(ins.time,strafesnet_common::integer::Ratio64::new(scale.num()*4,scale.den()*5).unwrap()); }, } },