mirror of
https://github.com/MineLittlePony/MineLittlePony.git
synced 2025-02-13 16:24:23 +01:00
Fix strafing getting stuck at invalid angles
This commit is contained in:
parent
3800bc2424
commit
46199208ce
1 changed files with 1 additions and 0 deletions
|
@ -58,6 +58,7 @@ public class RenderPonyPlayer extends RenderPonyBase {
|
||||||
double roll = (Math.toDegrees(Math.atan2(motionX, motionZ)) - yaw) % 360;
|
double roll = (Math.toDegrees(Math.atan2(motionX, motionZ)) - yaw) % 360;
|
||||||
|
|
||||||
if (roll < -180) roll += 360;
|
if (roll < -180) roll += 360;
|
||||||
|
if (roll > 180) roll -= 360;
|
||||||
|
|
||||||
roll *= horMotion * 2;
|
roll *= horMotion * 2;
|
||||||
roll = MathHelper.clamp(roll, -54, 54);
|
roll = MathHelper.clamp(roll, -54, 54);
|
||||||
|
|
Loading…
Reference in a new issue