Skip to content

Commit

Permalink
Fix direct fire not showing in tables
Browse files Browse the repository at this point in the history
  • Loading branch information
johnb432 committed Sep 19, 2024
1 parent 5541adc commit 354f8b6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion extension/src/artillery/simulate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,11 @@ pub fn find_solution(
return (-1.0, -1.0, -1.0);
}
let radicand = radicand.sqrt();
let angle_root =
let mut angle_root =
(muzzle_velocity.mul_add(*muzzle_velocity, radicand) / (GRAVITY * range_to_hit)).atan();
if angle_root > max_elev || angle_root < min_elev {
angle_root = (muzzle_velocity.mul_add(*muzzle_velocity, -radicand) / (GRAVITY * range_to_hit)).atan();
}
if angle_root > max_elev || angle_root < min_elev {
return (-1.0, -1.0, -1.0);
}
Expand Down

0 comments on commit 354f8b6

Please sign in to comment.