Skip to content

Commit

Permalink
fixed wrong modulo for autoaming in negative direction.
Browse files Browse the repository at this point in the history
  • Loading branch information
DerPavlov committed May 17, 2020
1 parent 317337f commit 2992a66
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/java/at/pavlov/cannons/Aiming.java
Original file line number Diff line number Diff line change
Expand Up @@ -340,8 +340,8 @@ private boolean setVerticalAngle(Cannon cannon, GunAngles angles, double step) {
*/
private GunAngles getGunAngle(Cannon cannon, double yaw, double pitch)
{
double horizontal = yaw - CannonsUtil.directionToYaw(cannon.getCannonDirection()) - cannon.getTotalHorizontalAngle();
horizontal = horizontal % 360;
double horizontal = yaw - CannonsUtil.directionToYaw(cannon.getCannonDirection()) - cannon.getTotalHorizontalAngle();
//horizontal = horizontal % 360;
while(horizontal < -180)
horizontal = horizontal + 360;

Expand Down

0 comments on commit 2992a66

Please sign in to comment.