avoid double rocket boost

This commit is contained in:
Quaternions 2023-11-11 21:27:20 -08:00
parent 5b26304e95
commit 46d6c31957

View File

@ -1544,10 +1544,7 @@ impl crate::instruction::InstructionConsumer<PhysicsInstruction> for PhysicsStat
PhysicsInputInstruction::Idle => {refresh_walk_target=false;},//literally idle! PhysicsInputInstruction::Idle => {refresh_walk_target=false;},//literally idle!
} }
if refresh_walk_target{ if refresh_walk_target{
let mut a=self.refresh_walk_target(); let a=self.refresh_walk_target();
if let Some(rocket_force)=self.style.rocket_force{
a+=self.style.get_propulsion_control_dir(&self.camera,self.controls,&self.next_mouse,self.time)*rocket_force;
}
if set_acceleration_cull(&mut self.body,&mut self.touching,&self.models,a){ if set_acceleration_cull(&mut self.body,&mut self.touching,&self.models,a){
(self.move_state,self.body.acceleration)=self.touching.get_move_state(&self.body,&self.models,&self.style,&self.camera,self.controls,&self.next_mouse,self.time); (self.move_state,self.body.acceleration)=self.touching.get_move_state(&self.body,&self.models,&self.style,&self.camera,self.controls,&self.next_mouse,self.time);
} }