Skip to content

Commit c617807

Browse files
authored
Update animation.ts
1 parent c771fb9 commit c617807

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/animation.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,9 @@ export class CrouchAnimation extends PlayerAnimation {
237237
private isCrouched: any;
238238
protected animate(player: PlayerObject): void {
239239
var pr = this.progress * 8;
240+
if (pr === 0) {
241+
this.isCrouched = undefined;
242+
}
240243
if (this.runOnce) {
241244
if (pr > 1) {
242245
pr = 1;
@@ -255,7 +258,7 @@ export class CrouchAnimation extends PlayerAnimation {
255258
player.cape.position.y =
256259
8 - 1.851236166577372 * Math.abs(Math.sin((pr * Math.PI) / 2));
257260
player.cape.rotation.x =
258-
0.18849555921538758 +
261+
(10.8 * Math.PI) / 180 +
259262
0.294220265771 * Math.abs(Math.sin((pr * Math.PI) / 2));
260263
player.cape.position.z =
261264
-2 +
@@ -264,7 +267,7 @@ export class CrouchAnimation extends PlayerAnimation {
264267
player.elytra.position.x = player.cape.position.x;
265268
player.elytra.position.y = player.cape.position.y;
266269
player.elytra.position.z = player.cape.position.z;
267-
player.elytra.rotation.x = player.cape.rotation.x;
270+
player.elytra.rotation.x = player.cape.rotation.x - (10.8 * Math.PI) / 180;
268271
var pr1 = this.progress / this.speed;
269272
if (Math.abs(Math.sin((pr * Math.PI) / 2)) === 1) {
270273
this.erp = !this.isCrouched ? pr1 : this.erp;

0 commit comments

Comments
 (0)