More % for yaw.

This commit is contained in:
asofold 2012-12-29 16:23:04 +01:00
parent f9d44cd661
commit 7f17420606

View File

@ -47,9 +47,9 @@ public class Combined {
public static final void feedYawRate(final Player player, float yaw, final long now, final String worldName, final CombinedData data) { public static final void feedYawRate(final Player player, float yaw, final long now, final String worldName, final CombinedData data) {
// Reset on world change or timeout. // Reset on world change or timeout.
// Ensure the yaw is within bounds (TODO: better method, maybe). // Ensure the yaw is within bounds.
while (yaw <= -360.0) yaw += 360.0; if (yaw <= -360f) yaw = -((-yaw) % 360f);
if (yaw >= 360.0) yaw -= 360.0; else if (yaw >= 360f) yaw = yaw % 360f;
// Timeout, world change. // Timeout, world change.
if (now - data.lastYawTime > 999 || !worldName.equals(data.lastWorld)){ if (now - data.lastYawTime > 999 || !worldName.equals(data.lastWorld)){