drop droppable instructions
This commit is contained in:
parent
68ccee81b1
commit
97da935d9d
@ -27,9 +27,11 @@ impl BotDebug{
|
||||
std::mem::drop(self.file);
|
||||
std::fs::remove_file(self.name)
|
||||
}
|
||||
pub fn push(&self,ins:strafesnet_common::instruction::TimedInstruction<strafesnet_common::physics::Instruction>)->Result<(),binrw::Error>{
|
||||
let ins:TimedPhysicsInstruction=ins.into();
|
||||
self.file.write_le(&ins)
|
||||
pub fn push(&mut self,ins:strafesnet_common::instruction::TimedInstruction<strafesnet_common::physics::Instruction>)->Result<(),binrw::Error>{
|
||||
match TryInto::<TimedPhysicsInstruction>::try_into(ins){
|
||||
Ok(ins)=>self.file.write_le(&ins),
|
||||
Err(crate::newtypes::physics::PhysicsInputInstructionError::DropInstruction)=>Ok(()),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user