Fix cannon angles

This commit is contained in:
Shaun Bennett 2016-01-26 13:36:30 -06:00
parent 9215d0d3ff
commit 155d8bff1b

View File

@ -524,7 +524,11 @@ public class Cannon implements Listener
double standYaw = Math.toDegrees(armorStand.getHeadPose().getY()) % 360;
double riderYaw = _rider.getLocation().getYaw() % 360;
// riderYaw = 350 and standYaw = 20
// dif should be -30 and not 330
double dif = riderYaw - standYaw;
if (dif > 180) dif -= 360;
if (dif < -180) dif += 360;
double yaw = standYaw + Math.min(dif / 20.f, 5f);