fix type mistakes
This commit is contained in:
@@ -4,6 +4,7 @@ use strafesnet_roblox_bot_file::v0;
|
||||
use strafesnet_roblox_bot_player::{bot,head,time,graphics};
|
||||
use strafesnet_graphics::setup;
|
||||
use strafesnet_common::physics::Time as PhysicsTime;
|
||||
use strafesnet_common::run::Time as RunTime;
|
||||
|
||||
// Hack to keep the code compiling,
|
||||
// SurfaceTarget::Canvas is not available in IDE for whatever reason.
|
||||
@@ -77,7 +78,7 @@ impl CompleteBot{
|
||||
#[wasm_bindgen]
|
||||
pub fn run_duration(&self,mode_id:u32)->Option<f64>{
|
||||
let mode=v0::ModeID(mode_id);
|
||||
Some(self.bot.run_duration(mode)?.get() as f64/PhysicsTime::ONE_SECOND.get() as f64)
|
||||
Some(self.bot.run_duration(mode)?.get() as f64/RunTime::ONE_SECOND.get() as f64)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -131,7 +132,7 @@ impl PlaybackHead{
|
||||
pub fn get_head_time(&self,time:f64)->f64{
|
||||
let time=time::from_float(time).unwrap();
|
||||
let time=self.head.time(time);
|
||||
time.get() as f64/strafesnet_common::run::Time::ONE_SECOND.get() as f64
|
||||
time.get() as f64/PhysicsTime::ONE_SECOND.get() as f64
|
||||
}
|
||||
/// Set the playback head position to new_time.
|
||||
#[wasm_bindgen]
|
||||
@@ -146,7 +147,7 @@ impl PlaybackHead{
|
||||
let time=bot.bot.time(self.head.time(time));
|
||||
let mode=v0::ModeID(mode_id);
|
||||
let run_time=self.head.state().get_run(mode)?.time(time);
|
||||
Some(run_time.get() as f64/strafesnet_common::run::Time::ONE_SECOND.get() as f64)
|
||||
Some(run_time.get() as f64/RunTime::ONE_SECOND.get() as f64)
|
||||
}
|
||||
#[wasm_bindgen]
|
||||
pub fn is_run_in_progress(&self,mode_id:u32)->Option<bool>{
|
||||
|
||||
Reference in New Issue
Block a user